LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Duplicate entries in fstab (https://www.linuxquestions.org/questions/linux-software-2/duplicate-entries-in-fstab-473630/)

jrdioko 08-13-2006 11:28 PM

Duplicate entries in fstab
 
Is it possible to have multiple entries in /etc/fstab with the same device name? I have an external usb hard drive formatted as ReiserFS as well as various other usb devices with other filesystems, and it would be nice to have an entry for each (e.g. /mnt/hd would do ReiserFS, /mnt/camera would do vfat, etc. but all for /dev/sda1).

David the H. 08-13-2006 11:58 PM

If I'm following you, you mean you have multiple usb devices that when plugged in all show up as the same /dev/sda1 device, right?

I don't think it's possible to have multiple fstab entries for the same device entry. I tried that once and only got errors. But if your system is using udev, then it should be pretty easy to set it up to detect the individual devices when they are plugged in and create different device aliases for each one. That is, you can have a /dev/harddrive, a /dev/camera, /dev/flashdrive and so on. Then you can create different fstab entries for each of those devices.

Look here for info on creating udev device rules:
http://www.reactivated.net/writing_udev_rules.html

jrdioko 08-14-2006 12:06 AM

I don't have a 2.6 kernel, so no udev at this point. I don't mean multiple ones plugged it at the same time, but just various usb devices that I own with different filesystems. Since no one fstab entry will cover all of them, I thought it would be nice to have different mount points and use a different filesystem depending on which I use. Any way to do that without udev, or am I going to have to do manual mount commands all the time?

kstan 08-14-2006 01:08 AM

i think by default 'mount' will determine what file system you have, just make 1 script like:-
#!/bin/bash
sudo mount /dev/sda /home/user1/Desktop/usbdisk

*don't care who's usb hdd u use, this script will mount the partition.
Then later on you can create a custom menu at kde to mount the disk.
So, next time when you plugin the usb disk, you can use the menu to mount the disk to ~/Desktop/usbdisk


All times are GMT -5. The time now is 04:27 AM.