Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Distribution: Ubuntu Intrepid and Meerkat, formerly used Debian 3.1 (Sarge) with Gnome Desktop
help required with fstab
I have a USB hard disk which has two partitions (an ext3 partition and a Fat32 partition).
I am trying to configure my computer so that when I plug in the USB hard disk, both partitions appear with the permissions so that user can write to either partition without worrying about root permissions.
So what I did is create two entries in /etc/fstab which look like this:
/dev/sdb1 /media/usbdisk auto rw,user,auto,umask=000,gid=1000 0 0
/dev/sdb2 /media/usbdisk-1 auto rw,user,auto,umask=000,gid=1000 0 0
when I run
sudo mount -a
Only the Fat32 partition mounts. The ext3 partition gets an error like this:
wrong fs type, bad option, bad superblock on /dev/sdb2
NOw assuming that ext3 can be auto-detected, I imagine that one of my options is incorrect.
But the options look OK to me.
Does anyboday have any advice for me? any help with save me some stress.
What do you mean? Once you change the permissions, they should stay changed. Are you saying that when you reset the permissions, umount, the re mount the drive, they all change from what you set them to?
2) Add entries into /etc/fstab for the ext3 filesystem that you want fstab to mount:
/dev/sdb1 /media/usbdisk auto rw,user 0 0
/dev/sdb2 /media/usbdisk-1 auto rw,user 0 0
The above method is good because if you have more than one USB device and those devices are a mixture of EXT3 and FAT32, they will all automatically mount to the specified mount points above and they will easily eject without needing to be root or a sudo
/dev/sdb2 /media/usbdisk-1 auto default 0 0 would only work well for ext2 or ext3 filestystems.
3) Test how well the fstab works by doing:
sudo mount -a
4) ensure the filesystems mounted to the correct mount points and that all is OK
The only trouble now is, after a reboot, the EXT3 partition does not mount automatically. I have to do a "sudo mount -a" for it to mount. The impact of this is that i have to "sudo umount <mount point>" in order to unmount it, I cannot just right click its icon on the desktop and click "eject"
Last edited by greengrocer; 06-30-2007 at 07:00 AM.
For an external drive, you don't want it to automatically boot. If you did, the boot process would fail if the disk were ejected. Also, the next time you insert the disk, it might be assigned to a different device.
The "user" option will allow you to mount and umount the partition without having to be root.
Just enter "mount <mountpoint>" as a regular user.
For the vfat partition, use the uid,gid,fmask,dmask options to change the user, group, file permissions, and directory permissions respectively. The fat32 filesystem doesn't retain these values, so they are created by using mount options.
Here is the fstab entry I use for a usb external drive:
That's right. Then change the filetype, and don't use the uid, gid, umask, fmask or dmask options. Instead, initially mount the device as root. If it is a newly created filesystem, it will be owned by root. In that case, use the chown and chmod commands.
The "user" option will still allow you to mount the device as a normal user.
For an external device with a linux native filesystem, still use "noauto" and either UUID= or LABEL= in the device field. If your distro has a partitioner program, use it. That way you won't miss options like "acl,user_xattr" for ext3 if they were formatted to support them.
If it is a flash drive, use the noatime as well.
Of course if your HAL system is functioning properly, you wouldn't need an entry in /etc/fstab.
Here was an experiment I performed when answering another post:
The shortname=lower, and flush options I wasn't familiar with. What I did was:
Automounted the device
used "udevinfo -q env -n /dev/sdb1" to get the UUID number
Entered "mount" by itself and used the same options.
Added the options: user,noauto and the fmask and dmask values.
I'll let the system or a partitioner program figure out the font encoding and other special options. I'm not about to waste brain cells memorizing the various encoding schemes. Did you ever read the Sherlock Holmes book "A Study in Scarlet"? This is the book where Watson and Holmes met. Holmes explained that he will remember how many steps are in a landing, but wouldn't have the foggiest idea how far Mars is from Earth. That would waste precious brain cells.
At my age, I don't have any to spare. We can't grow new ones and some die all the time. That does make a good excuse for a bad memory. "Just recycling brain cells, because I'm maxed out".