1

A DAS box is attached to my linux box using LSI SCSI HBA. Volume is properly detected on the linux box and filesystem is created using

mkfs.ext3 /dev/sdc     #No partition table

I can not mount the volume using

mount/dev/sdc  /mnt/temp -t ext3

But I can mount it using

mount /dev/sdc  /mnt/temp -t ext3 -o loop

Can anybody please tell me what "-o loop" option does internally? Has anybody faced this option before?

Update 1: Here is the output of stat and file:

# stat /dev/sdc
File: /dev/sdc
Size: 0               Blocks: 0          IO Block: 4096   block special file
Device: dh/13d  Inode: 158         Links: 1     Device type: 8,20
Access: (0640/brw-r-----)  Uid: (    0/    root)   Gid: (    6/    disk)
Access: 2010-04-02 12:04:27.288467752 +0530
Modify: 2010-04-02 17:33:55.840630712 +0530
Change: 2010-04-02 12:03:59.609892979 +0530

# file /dev/sdc
/dev/sdc: block special (8/32)

Following is the error while mounting after creating the ext3 filesystem

# mount /dev/sdc /mnt/temp -t ext3
mount: wrong fs type, bad option, bad superblock on /dev/sdc,
   missing codepage or other error
   In some cases useful info is found in syslog - try
   dmesg | tail  or so

# dmesg
VFS: Can't find ext3 filesystem on dev sdc.

Thanks in advance, prashant

user39508
  • 11
  • 1
  • 3
  • Silly question, but why aren't you creating a partition table? – Matt Simmons Apr 03 '10 at 04:08
  • Hi Matt, Even if I create a partition table, it has the same behavior. I have not put those details to keep the question simple. Originally I asked this question on stackoverflow so that some filesystem developers could answer this question. I don't know why they moved it here. – user39508 Apr 05 '10 at 04:15

1 Answers1

1

Is /dev/sdc really a device not a file? That would explain why '-o loop' works.

The other thing is: you create a ext2 file system (mke2fs and mkfs.ext2 without '-j' option will create ext2, not ext3 file system) and are trying to mount it as ext3. Though, it is strange the loop mount succeeds.

'-o loop' mount options attaches a file (given as 'device' parameter to the mount command) to a loop device (/dev/loop0 by default if it is free) and then mounts that loop device. Loop device is a 'virtual' block device that represents a regular file on other filesystem.

mount -o loop some_file /mnt

is equivalent of:

losetup /dev/loop0 some_file
mount /dev/loop0 /mnt

And IMHO '-o loop' should not make any difference in recognizing and mounting a file system from a regular block device. If it works with regular block devices at all.

Whatever happens, there should be something about the problem in kernel logs (dmesg output).

Jacek Konieczny
  • 3,597
  • 2
  • 21
  • 22
  • Hi, /dev/sdc is a block device. yes, this problem is really strange. Actually we are developing this DAS box. There is no data corruption. As I see normal mount fails, there must be some problem. I want to know what information from /dev/sdc is ignored/skipped/assumed with -o loop option. That could give me some idea. I have updated the information in the question. Thanks, Prashant – user39508 Apr 02 '10 at 07:08
  • Have you tried actually making an ext3 filesystem (`mke2fs -j`. `mkfs.ext3` or `tune2fs -j` on an existing filesystem)? Or mounting the ext2 filesystem you have created as 'ext2', not 'ext3'? – Jacek Konieczny Apr 02 '10 at 07:12
  • I have created it using mkfs.ext3 /dev/sdc – user39508 Apr 02 '10 at 08:53
  • I have updated the question. By mistake I typed mkfs.ext2 instead of mkfs.ext3 in the question. Now the question makes sense. – user39508 Apr 03 '10 at 01:25