Linux Newbie help
 help / color / mirror / Atom feed
From: Prasad Joshi <prasadjoshi124@gmail.com>
To: linux-newbie@vger.kernel.org
Subject: Mounting block device fails.
Date: Thu, 8 Oct 2009 12:40:32 +0530	[thread overview]
Message-ID: <fe291c8c0910080010n2708c986g99b4f82b74c3d410@mail.gmail.com> (raw)
In-Reply-To: <fe291c8c0910080003m470520adsd4a7e37bf676458b@mail.gmail.com>

Hi,

I am working on translation layer for flash. For the purpose testing I
am using a disk file to simulate the flash behavior. So every read and
write on the block device finally goes to a disk file, something
similar to loop device, but in addition maintaining the flash
property.

I am able to create the file system on the device (/dev/ftl) but when
I try to mount the device it fails with error "Invalid Argument".

I thought it is failing to read the super block of the file systems,
but it seems like it did not fail in superblock read

# strace -o out mount -t ext2 /dev/ftl /mntpt/
[  175.192033] Opening the device.
[  175.193599] IftlIoRead: offset=0x400 Length=0x400
[  175.193875] OffsetWithinPage: 400
[  175.195104] Read pos=1002535424, length=8192
[  175.195474] 0000 0001 0000 0004 3333 0000 eea5 0003 fff5 0000 0000
0000 0002 0000 0002 0000 8000 0000 8000 0000 2000 0000 0000 0000 8a9e
4acd 0000 0020 ef53 0001 0001 0000 8a9e 4acd 4e00 00ed 0000 0000 0001
0000 0000 0000 000b 0000 0100 0000 0038 0000 0002 0000 0003 0000 a037
8e0c d6b3 de11 abb8 0635 bff9 2b36 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 003f 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 a037 8f0c d6b3 de11 abb8
0635 bff9 2b36 0001 0000 0000 0000 0000 0000 8a9e 4acd 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 001c 001c 0001 0000 0000
0000 0000 0000 0000 0000 0000 0000 [  175.215929] Closing the device.
mount: mounting /dev/ftl on /mntpt/ failed: Invalid argument

I tried printing the data in hex format just to make sure proper ext2
magic code in present in the superblock read from the flash device.
"ef53" is the magic code of ext2 superblock, ftl device is correctly
reading the magic code

# cat out
execve("/bin/mount", ["mount", "-t", "ext2", "/dev/ftl", "/mntpt/"],
[/* 4 vars */]) = 0
uname({sys="Linux", node="(none)", ...}) = 0
brk(0)                                  = 0x72f000
brk(0x72ff40)                           = 0x72ff40
arch_prctl(ARCH_SET_FS, 0x72f880)       = 0
open("/dev/urandom", O_RDONLY)          = -1 ENOENT (No such file or directory)
brk(0x750f40)                           = 0x750f40
brk(0x751000)                           = 0x751000
getuid()                                = 0
getuid()                                = 0
geteuid()                               = 0
stat("/dev/ftl", {st_mode=S_IFBLK|0644, st_rdev=makedev(254, 0), ...}) = 0
mount("/dev/ftl", "/mntpt/", "ext2", MS_SILENT, "") = -1 EINVAL
(Invalid argument)
vfork()                                 = 869
--- SIGCHLD (Child exited) @ 0 (0) ---
write(2, "mount: mounting /dev/ftl on /mntp"..., 61) = 61
exit_group(-1)                          = ?

What could be the reason of failure of mount?

Thanks and Regards,
Prasad
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

       reply	other threads:[~2009-10-08  7:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fe291c8c0910080003m470520adsd4a7e37bf676458b@mail.gmail.com>
2009-10-08  7:10 ` Prasad Joshi [this message]
     [not found] ` <fe291c8c0910080008g22da5bb0n3f106d644da0fbe8@mail.gmail.com>
2009-10-08 13:11   ` Mounting block device fails Manish Katiyar
2009-10-09  5:46     ` Prasad Joshi
2009-10-09  5:58       ` Manish Katiyar
2009-10-09  6:04         ` Manish Katiyar
2009-10-09  7:10           ` Prasad Joshi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe291c8c0910080010n2708c986g99b4f82b74c3d410@mail.gmail.com \
    --to=prasadjoshi124@gmail.com \
    --cc=linux-newbie@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox