When I used to use the Amiga (I still do from time to time) I could refer to drives via their device names, but it was simpler and easier to use a human-oriented label. That way the machine found the correct drive no matter where it was plugged in. I felt sure Linux must have such a capability. It does, but for some reason almost nobody seems to use it.
It is a special problem in Puppy because the mount command uses busybox by default. I've had a lot of problems with busybox in the past and have come to detest it. Oddly, Puppy also contains the full mount command (as mount-FULL) and this is how we can fix it.
NOTE: In the examples below I use my own external drive formatted to ext3 format, on /dev/sdb1 and my own label wd00. You should substitute your own particular device, its format, and a label of your own choosing. I find writing it this way is easier for people to follow.
I mounted the drive for a moment to check its device address first. Once I knew that I unmounted it again. You can use pmount to get that info without mounting and unmounting anything though.
Now that I know where the drive is connected, I can label it:
Code: Select all
e2label /dev/sdb1 wd00
Next I verified the label
Code: Select all
blkid /dev/sdb1
Code: Select all
/dev/sdb1: UUID="f3683b08-4b9b-4dc0-8a7a-817f40ce8dfe" SEC_TYPE="ext2" TYPE="ext3" LABEL="wd00"
Make a folder somewhere convenient. Use the command line or right-click the filelist in rox to make a new directory. (I choose to put it in /mnt, though you can use / if you want, and I notice Ubuntu has started using a new place called /media for mounting usb drives.) It can be named whatever I want, but it's best to give it the same name as the disklabel to simplify matters
Code: Select all
mkdir /mnt/wd00
Code: Select all
mount-FULL -t ext3 -L wd00 /mnt/wd00
Code: Select all
ls /mnt/wd00
One problem remains though. I'd like the drive to be recognised automatically without having to give the long mount command every time I want to mount it. This requires adding an entry in the /etc/fstab file. Here is the line I added for mine:
Code: Select all
LABEL=wd00 /mnt/wd00 ext3 defaults 0 0
Now I have to change Puppy's mount command to be able to use labels. This is pretty easy because in Puppy it is actually a script. You can do it one of 2 ways:
EITHER
In case of problems make a backup of the mount script (call it mount-script). Load /bin/mount into a text editor (e.g. geany). Do not use a word processor! I edited the 3 places (two near the beginning and one near the end of the file) that refer to busybox so instead of saying busybox mount it says mount-FULL. The 3 lines I changed are:
Code: Select all
[ ! $1 ] && exec busybox mount
busybox mount $@
busybox mount -r -t ntfs $CMDPRMS
Code: Select all
[ ! $1 ] && exec mount-FULL
mount-FULL $@
mount-FULL -r -t ntfs $CMDPRMS
OR
(My preferred choice.) If you don't have any Microsoft Windows ntfs drives you could simply rename the mount script as mount-script and make a link to mount-FULL called mount (easiest way is to right-click on mount-FULL, choose Link from the popup menu and call it mount). Now Puppy will use the proper mount program which avoids the mess of editing the mount script, but loses the nice ntfs handling done by Puppy programmers. It may still work fine with ntfs, but as I mentioned, I don't have any ntfs drives so can't test it.
Now after the change to fstab and the mount command I can simply click on the icon /mnt/wd00 and it will mount and open the disk no matter what USB port it is connected to. I've dragged the icon to my desktop for convenience.
Ta-da!
I know it sounds like a lot to do, but that's only because I've discussed in detail each step. If you are advanced then it is simply a matter of
- * giving your drive a label with e2label <device> <label>
- * making a mount-point for the drive, perhaps in /mnt/<label>
- * mounting the drive using mount-FULL -t <format-type> -L <label> <mount-point>
or
adding a line in fstab, in which case /bin/mount must be altered to use the proper mount command instead of busybox.