LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   fstab, mtab, and Gnome (https://www.linuxquestions.org/questions/linux-hardware-18/fstab-mtab-and-gnome-705163/)

drkhelmt 02-16-2009 03:56 PM

fstab, mtab, and Gnome
 
Greetings,

I'm having a little trouble understanding and how to fix this quagmire. I'm simply trying to change the default mount point of a USB drive.

I am working with SuSE Enterprise Dektop (SLED) 10.2. I have one harde drive (sda) in the laptop with 3 partiticions (one ntfs for windows, one fat for data, and one reiserfs for Linux). I also have one more hard drive and internal laptop drive (sdb) with 1 partition (one reiserfs for data) in a vantec sx enclosure connecting to my laptop by way of USB2.0.

If I leave my fstab file alone
Code:

/dev/sda6            /                    reiserfs  acl,user_xattr        1 1
/dev/sda3            /DataStore          vfat      users,gid=users,umask=0002,utf8=true 0 0
/dev/sda1            /windows            ntfs      ro,users,gid=users,umask=0002,nls=utf8 0 0
/dev/sda5            swap                swap      defaults              0 0
proc                /proc                proc      defaults              0 0
sysfs                /sys                sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts              /dev/pts            devpts    mode=0620,gid=5      0 0

Sdb1 is mounted to /media/disk, the disk shows up in nautilus in gnome as one drive. /etc/mtab is as follows
Code:

/dev/sda6 / reiserfs rw,acl,user_xattr 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
debugfs /sys/kernel/debug debugfs rw 0 0
udev /dev tmpfs rw 0 0
devpts /dev/pts devpts rw,mode=0620,gid=5 0 0
/dev/sda3 /DataStore vfat rw,noexec,nosuid,nodev,gid=100,umask=0002,utf8=true 0 0
/dev/sda1 /windows ntfs ro,noexec,nosuid,nodev,gid=100,umask=0002,nls=utf8 0 0
/dev/sdb1 /media/disk reiserfs rw,nosuid,nodev 0 0

Now, if I add this to fstab
Code:

/dev/sdb1            /media/MoreStuff          reiserfs  auto,user,rw            0 0
Sdb1 is mounted to /media/MoreStuff which is where I want it. Unfortunately, Nautilus shows 2 drives instead of one and one. Clicking on one will take me to the drive, clicking ont he other will give me an error that sdb1 is already mounted.

Can someone please explain the difference between fstab and mtab and where the default mount points of USB devices are stored?

Thanks in advance.

digerati1338 02-16-2009 04:10 PM

fstab is the filesystem table. mtab is the mount table, listing only mounted devices. You can edit fstab to change mount points, but you shouldn't mess with mtab. I don't know how to change the default mount point of a usb device off hand, but I think it is usually mounted as /media/<volume label>. If it's getting mounted as /media/disk it might mean it has no label. Changing the label may be one way to solve your problem.

My other thought is that I think use drives are represented in fstab by this line:
Code:

usbfs                /proc/bus/usb        usbfs      noauto                0 0
And if that is the case, you are creating two mount points for one device by adding /dev/sdb1. You might try googling for usbfs mount points if you want to try to change the mount point a different way.

rabbit2345 02-16-2009 04:12 PM

Hi,

/etc/fstab stands for FileSystemTABle. All information about mount points, filesystems of volumes are stored in here, like default mountpoints.

/etc/mtab stands for MountTABle. The only job of /etc/mtab is to record the filesystems that are currently mounted. !Never edit /etc/mtab directly!

So to change the default mountpoint of your USB disk, find out what device it is. It's probably going to be /dev/sdb1 for you. Your system will automount it in /media if there is no entry.

It appears you entry was correct, but try taking the 'auto' part out. It may be trying to mount it twice.

good luck,
rabbit2345

Didier Spaier 02-16-2009 04:16 PM

/etc/fstab records how the devices should be mounted. It is populated by the system administrator.
/etc/mtab tells which devices are actually mounted, and on which mountpoint.

When you issue the command 'mount' with no arguments, it parse /etc/mtab to answer you.

When you issue it with arguments it mounts some device according to either /etc/fstab or the mount point you indicate.

To know more: 'man fstab' and 'man mount'


All times are GMT -5. The time now is 10:00 AM.