After formatting my “new” USB 2.0 hard drive I wanted to be able to plug it in any USB port while still being able to mount it automatically /etc/fstab. I was concerned that the device name might change if I moved it to a different USB port or booted with other memory cards or drives connected.
I’m using a FAT32 file system on this drive so it can be accessed from both Linux and the PS3’s XMB. I didn’t create a label when I originally formatted it.
To create a label for the existing FAT32 file system on my USB hard drive and have it automatically
mounted in the same location every time I boot, I followed this process (learned from this thread on fedoraforum.org):
0. Become the root user:
su -l root [root password]
1. Confirm which device name to use with:
fdisk -l
This is how my drive shows up in the list:
Disk /dev/sdd: 60.0 GB, 60011642880 bytes 255 heads, 63 sectors/track, 7296 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdd1 1 7296 58605088+ c W95 FAT32 (LBA)
2. Use dosfslabel to assign a label (assuming drive is FAT32 formatted and there isn’t one already):
dosfslabel /dev/sdd1 apricorn
Where /dev/sdd1 is the current device name confirmed in Step 1, and apricorn is the label (this could be anything you want, but needs to match the LABEL used in Step 5).
3. Add the mount point:
mkdir /media/apricorn
It doesn’t necessarily have to match the label or be located in /media, but it does need to match the mount point you put in /etc/fstab in Step 5, below.
4. Check your username’s uid & gid:
id yourusername
(replace yourusername with your regular username)
5. Add this entry to /etc/fstab:
LABEL=apricorn /media/apricorn vfat sync,rw,uid=500,gid=500 0 0
Replace apricorn with the label you created in Step 2.
Replace /media/apricorn with the mount point you created in Step 3.
Replace uid=500,gid=500 with your uid & gid from Step 4 (probably the same).
The sync option causes data to be written to the drive immediately in case it is accidently removed without unmounting it first. The uid / gid option gives the user full access to the files on the drive.
6. Reboot.
Immediately after rebooting the drive should show up on your Desktop (if you’re using
Gnome) and be accessible from the mount point you created (/media/apricorn in my case).
I also used the same process for a FAT32-formatted Sandisk Extreme III 4 GB Compact Flash card on my PS3, adding more storage space that’s accessible immediately when I start up in Linux or the Game OS.
For further reference:
http://wiki.archlinux.org/index.php/Persistent_block_device_naming
UPDATE: I’m not sure yet, but I think the Game OS doesn’t like my FAT32 (LBA) partition — the USB drive isn’t showing up as it should on the XMB. I need to try another device formatted as FAT32 (LBA) instead of just FAT32 to see if it makes any difference.


