USB Memory Sticks and Linux
USB memory sticks and Linux work pretty painlessly. One plugs the things in, the kernel detects them automatically. One mounts them, assuming the system has been set up to allow users to mount filesystems, one uses them, one unmounts them, and one pulls them out again. What could be simpler?
In TCM the mount-points are /usb and /usb2, following our normal naming convention (including /cdrom), so
> mount /usbwill mount, and
> umount /usbwill unmount it. If two are inserted at once, the second will be /usb2.
If you have switched to the XFCE desktop, then you simply need to insert the stick, it will mount automatically, and, before removing, you need to right-click on the desktop icon and choose "eject" or "unmount" to avoid potential data corruption on the stick. This is precisely analogous to MacOS or Windows.
A few tedious details follow, to help those who get knotted with the things. Much of this is deducable from /etc/fstab.
What is it?
Physically it's a bit of non-volatile memory. However, as far as any operating system is concerned, it's a SCSI disk drive. Like any other SCSI disk drive, it can have a partition table, and any sort of filing system. Linux in TCM will be happy if the filing system is any form of FAT, which it usually is. It will be happy if the device has no partition table, or if you wish to mount the first partition. Again, this covers almost all cases.
The "device" might be a camera or external disk, rather than a "stick" or "keyring": most USB mass storage devices follow the same standards.
Linux notices when a USB device is plugged in, and tries to detect it and load the correct kernel module automatically. This usually works perfectly. It will not automatically mount it for two reasons. Firstly, it confuses humans who then expect automatic unmounts to occur (presumably in anticipation of the removal of the device, in a fashion which would break causality). Secondly, it is not always obvious who should own the mount -- users other than the person logged on at the console may use the USB ports.
What can go wrong?
The USB device is removed without first unmounting it. Ooops. The unmount forces all writes to complete (rather than sitting in the cache), so you may corrupt the filesystem on the USB device by doing this.
The device is NTFS or HFS+ formatted. Sorry, we don't support those, for Linux's support is in general poor.
The device is ext2/ext3 formatted, and due to the way in which UFSes store user ids, you don't have write access to anything on the device which you wrote from a different computer system.
Once the device is over a couple of hundred GB, it is very unclear which filing system one should use. VFAT32 becomes very slow, and ext3 has user-id mapping problems. This probably leaves one with exFAT, with slight concerns about patent licencing.
The largest file one can put on a VFAT filing system is 4GB. One way around this is
pc0:~$ split -b 3G huge.iso /usb/huge.iso.partthen
mylaptop:~$ cat /media/stick/huge.iso.part* > huge.isoas anyone old enough to remember splitting files between multiple floppy disks will be able to confirm!
Machines in TCM
Our more modern machines have convenient front-mounted USB sockets. For the others, various forms of USB extension leads or hubs can be obtained on request.