RHEL3 Mounting USB after reboot and between reboots: root and non-root users
Hi,
Question: How to keep /etc/fstab between reboots for non-root users to mount USB?
My RHEL3 on reboot calls /etc/init.d/kudzu start, by which it then calls /usr/sbin/updfstab.
The result in /etc/fstab is (I'll just copy the detected kudzu marked devices:
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/sda1 /mnt/flash auto noauto,owner,kudzu 0 0
Because: "users" is not added to /dev/sda1 on boot, only the device owner (root) mounts USB. I want non-root users to mount USB pens and not have this result:
$ mount /dev/sda1 /mnt/flash
mount: only root can do that
$ mount /dev/sda /mnt/flash
mount: only root can do that
Note: root user can mount /mnt/flash with sda (partition 0), not with sda1
$ mount -t vfat /dev/sda1 /mnt/flash
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
or too many mounted file systems
$ mount /dev/sda /mnt/flash
- /etc/mtab shows
/dev/sda /mnt/flash vfat rw 0 0
Does seem an issue with /dev/sda1, I don't know, proceeding with analysis.
So, I tried Manual update to /etc/fstab, knowing the changes/added entries will be gone on reboot. I tried adding "users"
/dev/sda1 /mnt/flash auto noauto,users,owner,kudzu 0 0
$ mount /dev/sda1 /mnt/flash
$ mount /dev/sda /mnt/flash
Still get the "only root" message.
Note: root user can mount /mnt/flash with sda (partition 0)
$ mount /dev/sda /mnt/flash
- /etc/mtab shows
/dev/sda /mnt/flash vfat rw 0 0
So, I tried mounting the Floppy (similar fstab entry, looking for pattern) with a non root user.
$ mount /dev/fd0 /mnt/floppy
Still get the "only root" message. So same pattern here.
So, I tried something else with Floppy, still with non root user:
$ mount /mnt/floppy
Hay, I'ts mounted - /etc/mtab:
/dev/fd0 /mnt/floppy vfat rw,nosuid,nodev,user=oracle 0 0
Ok, now tried same thing with USB:
$ mount /mnt/flash
mount: I could not determine the filesystem type, and none was specified
$ mount -t auto /mnt/flash
mount: only root can do that
$ mount -t vfat /mnt/flash
mount: only root can do that
Grrrr! So, I tried as suggested from my Flash doc for unix mount:
- mkdir /mnt/USB
- edit /fstab using /dev/sda (paritition 0, and not sda1), had to ajust and add "users"
/dev/sda /mnt/USB auto noauto,users,owner,kudzu 0 0
Pretty much the some thing as for /mnt/flash, huh!
$ mount /mnt/USB
Voal�, mounted - /etc/mtab shows:
/dev/sda on /mnt/USB type vfat (rw,noexec,nosuid,nodev)
So, back t the top question - see above.
|