Floppies for the New Millennium
The uid and gid mount options are those of my own login account to set file ownerships. More significant is the noatime, provided in order to eliminate unnecessary erase/write cycles. Don't forget, simply doing an ls on any directory will increment the files' atime (access time).
Alert readers may be thinking: “Wait, there's no atime on FAT filesystems!” True. There's only a single timestamp field for each file or directory, but Linux deals with this by updating that single time value on any occasion it ordinarily would update atime, mtime or ctime. So, disabling atime still reduces the frequency of erase/write operations, even on FAT.
All of those mount options can and should be put in /etc/fstab:
/dev/sda /mnt/fob vfat ↪uid=1000,gid=1000,user,noauto,noatime 0 0
One further oddity—no matter what you do, the flash disk always mounts read-only:
mount: block device /dev/sda is write-protected, mounting read-only
This happens even if you specify rw among the mount options. However, you subsequently can enable write access after mounting the flash disk, by remounting with the rw option:
# mount -o rw,remount /mnt/fob
Exactly why /bin/mount insists that the flash disk is write-protected and must be mounted read-only is a genuine mystery. Although some flash disks' plastic casings reportedly sport write-protect switches, the Easy Disk's doesn't. My best guess is that mount is heeding a request from the Easy Disk's built-in controller chip, intended to minimise accidental device fatigue. And it works. As a side benefit, the read-only default seems to render harmless your unplugging of the device when, inevitably, you forget to unmount it first—making it truly a hot-plug device.
Having coped with the hurdles and minor oddnesses of getting Linux support configured for the flash drive—or pen drive, as they are sometimes called—what strikes one most about these devices is how they fade to background. You simply rely on them and take them for granted, which is the mark of any truly successful technology. Documents and applications you use frequently, GnuPG and other crypto keys and files you need to transport among computers, regardless of operating system, are stored on the flash disk and dropped into your pocket. You don't have to worry about magnetic fields, mechanical shock, spontaneous bit-rot or anything else. It simply plugs in to a free port and works. There's nothing else quite like it.
Article about using Linux on a flash drive that registers as /dev/sda1 instead of /dev/sda: www.gctglobal.com/Download/3rd_LED/PalmKey/palmkey.html.
ATAPI Removable Media Device (ARMD) BIOS Specification, formerly the ATAPI Removable Drive (ARMD) Specification: www.phoenix.com/resources/specs-atapi.pdf.
Linux also supports CF devices and can boot from them. See the Memory Technology Device (MTD) Subsystem for Linux Site: www.linux-mtd.infradead.org.
Rick Moen is a sysadmin, writer and IT guy in the San Francisco Bay area where he has been a longtime member of its Linux community for which he runs an on-line calendar of upcoming events, BALE (Bay Area Linux Events, linuxmafia.com/bale).
Special Reports: DevOps
Have projects in development that need help? Have a great development operation in place that can ALWAYS be better? Regardless of where you are in your DevOps process, Linux Journal can help!
With deep focus on Collaborative Development, Continuous Testing and Release & Deployment, we offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, advice & help from the experts, plus a host of other books, videos, podcasts and more. All free with a quick, one-time registration. Start browsing now...