LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   mount fails for user but works for root (http://www.linuxquestions.org/questions/linux-kernel-70/mount-fails-for-user-but-works-for-root-4175427229/)

CollieJim 09-14-2012 07:16 AM

mount fails for user but works for root
 
I have my periodicals library on an SD card formatted as ext2. It has a single partition labeled LIBRARY. If I try to mount it as user, I get
Code:

370 19:37:19 ~ $ mount /mnt/Library/
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

However, if I 'mount <device> <mount-point>' as root, it works.
/etc/fstab contains:
Code:

LABEL=LIBRARY            /mnt/Library ext2  user,auto,exec,dev,suid,rw,umask=000    0 0
Code:

503 19:45:42 / # e2label /dev/sdc1
LIBRARY

dmesg | tail yields:
Code:

[19583.208998] sd 7:0:0:0: Attached scsi generic sg2 type 0
[19583.870056] sd 7:0:0:0: [sdc] 7744512 512-byte logical blocks: (3.96 GB/3.69 GiB)
[19583.870926] sd 7:0:0:0: [sdc] Write Protect is off
[19583.870939] sd 7:0:0:0: [sdc] Mode Sense: 03 00 00 00
[19583.872452] sd 7:0:0:0: [sdc] No Caching mode page present
[19583.872459] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[19583.877301] sd 7:0:0:0: [sdc] No Caching mode page present
[19583.877309] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[19583.913224]  sdc: sdc1
[19583.917782] sd 7:0:0:0: [sdc] No Caching mode page present
[19583.917790] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[19583.917798] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[19600.586332] FAT-fs (sdc1): bogus number of reserved sectors
[19600.586341] FAT-fs (sdc1): Can't find a valid FAT filesystem
[19771.145126] FAT-fs (sdc1): bogus number of reserved sectors
[19771.145135] FAT-fs (sdc1): Can't find a valid FAT filesystem
[19970.484559] EXT2-fs (sdc1): warning: mounting unchecked fs, running e2fsck is recommended

On successful mount, /etc/mtab has:
Code:

/dev/sdc1 /mnt/Library ext2 rw 0 0
When /etc/fstab and the card are consistent, why is the system trying to mount it as FAT-fs?????

Puzzled
Jim

414N 09-14-2012 07:28 AM

Quote:

Originally Posted by CollieJim (Post 4780214)
Code:

[
[19600.586332] FAT-fs (sdc1): bogus number of reserved sectors
[19600.586341] FAT-fs (sdc1): Can't find a valid FAT filesystem
[19771.145126] FAT-fs (sdc1): bogus number of reserved sectors
[19771.145135] FAT-fs (sdc1): Can't find a valid FAT filesystem
[19970.484559] EXT2-fs (sdc1): warning: mounting unchecked fs, running e2fsck is recommended


Guess what I would do prior to mounting it... ;)

CollieJim 09-14-2012 08:11 AM

No change.
Code:

504 21:06:09 / # e2fsck /dev/sdc1
e2fsck 1.42 (29-Nov-2011)
LIBRARY was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
LIBRARY: 1650/241920 files (1.1% non-contiguous), 506484/967040 blocks
505 21:06:37 / #

The mount still fails.

414N 09-14-2012 08:17 AM

Code:

fdisk -l /dev/sdc
?

CollieJim 09-14-2012 08:25 AM

Bingo!
Code:

505 21:06:37 / # fdisk -l /dev/sdc

Disk /dev/sdc: 3965 MB, 3965190144 bytes
19 heads, 48 sectors/track, 8491 cylinders, total 7744512 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbf9bbf9b

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1  *        8192    7744511    3868160    b  W95 FAT32
506 21:21:04 / #

Next question: When I formatted the partition as ext2, why was "W95 FAT32" not changed?
Original question: Why does mount work for root but not user?

414N 09-14-2012 08:34 AM

Next answer: because Linux doesn't care about the type of partition reported in fdisk; instead, it looks at the partitions themselves to look their type. Some other OS (I think it starts with a W :)) only look at that. You can fix that using fdisk on /dev/sdc (change a partition system id).
Original answer: I don't know... BTW, the umask option in your fstab file is useless with an ext2 mount (it's used on vfat and ntfs mounts).


All times are GMT -5. The time now is 07:50 AM.