First of all, you should have /dev/sda1 and /dev/sdb1 instead of /dev/sda & /dev/sdb.
What are the filesystems on each drive. I have used the mlabel program to label FAT partitions. For example, I have an SD card labeled "podcasts". Inserting it, it is automounted as /media/PODCASTS. You could also create an entry in /etc/fstab using "LABEL=<Label Name>", e.g. "LABEL=PODCASTS" instead of /dev/sdb1.
You can also use the UUID number of the filesystem in place of the device entry in /etc/fstab.
One of the commands that is handy in looking up the label or UUID of a partition is the "udevinfo" command
Code:
udevinfo -q env -n /dev/sdb1
ID_VENDOR=SanDisk
ID_MODEL=Cruzer_Mini
ID_REVISION=0.1
ID_SERIAL=SanDisk_Cruzer_Mini_200517395007FC20132F
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:02.1-usb-0:1.2:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT16
ID_FS_UUID=3B69-1AFD
[/b]ID_FS_LABEL=CRUZERMINI2[/b]
ID_FS_LABEL_SAFE=CRUZERMINI2
Install the "mtools" package if you have it. This package supplies the "mlabel" package. Add the following line to
/etc/mtools.conf:
drive p: file="/dev/sdb1". The p: device name is arbitrary. The default config will cover your floppy drives, but adding such a line will probably be needed to assign a dos type device name to a linux device. The /etc/mtools.conf file is well commented with plenty of commented out examples.
Use the appropriate value for the device, either /dev/sda1 or /dev/sdb1 in your case.
Now you can use mlabel to relabel the drive like this:
mlabel p:
label
Using my example:
Code:
sudo mlabel -s p:
Volume label is CruzerMini256 (abbr=CRUZERMINI2)
jschiwal@hpamd64:~> sudo mlabel p:XMasMusic
You will need to safely eject the drive, and then reinsert it. It should automount with the new label.
----
If these are removable drives you don't want to have them mounted when you boot. If one of them is disconnected, it will cause a stall or a failure to boot up successfully.
If your system doesn't use udev, and drives don't automount, then you could have entries in /etc/fstab that include the options "noauto,user,uid=
username,gid=
groupname".
This will allow you to mount these drives as a normal user without having to use sudo or enter a password. You would need to create a mount point for it, but this would allow you to include the mount commands in your ~/.profile file.
Here is how the XMASMUSIC pendrive automounted:
Code:
/dev/sdb1 on /media/XMASMUSIC type vfat (rw,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower
So if I wanted to use an fstab entry I would probably use:
Code:
LABEL=XMAS /media/XMAS vfat rw,nosuid,nodev,noatime,flush,uid=jschiwal,fmask=117,dmask=007,utf8,shortname=lower