And now, for a list of Linux commands i always forget about:
To get the GUID of a drive (so that a given hard drive ALWAYS mounts up under a given directory):
blkid /dev/drive
(and insert into /etc/fstab as:
UUID=UUID mount path ext3 defaults 0 2
To compare two different directories:
diff -rq dir1 dir2 > dirs.diff
To copy ginormous files:
rsync --inplace --progress --checksum --sparse --whole-file !*
After mounting a drive, make it available for NFS export by adding it to /etc/exports
/d2/ *(rw,sync,no_subtree_check)
and then running
exportfs -a
(This will keep NFS from reporting stale handles and locking on requests, even after a reboot.)
i've also learned to really appreciate Audio::WMA and MP3::Info to help me identify duplicate tracks (and which one to nuke).
Now, i wonder how long before i forget that i created this so i could remember the commands i forget.
(Hopefully, slightly longer than it took for me to figure out what the hell that last sentence meant.)
-
Regard the UUID "always mounts", bear this in mind. That UUID to block device "check" only happens at mount time, so if you have: /dev/sda1 UUID=XXXXXX and you mount XXXXXX on /mnt/x, it looks it up, and mounts /dev/sda1 on /mnt/x However, if you now add a removable media device, or you're using something like iSCSI with LUNs that can change on the fly, and all of a sudden you have /dev/sda1 UUID=YYYYYYY /dev/sdb1 UUID=XXXXXX (on a running filesystem), /mnt/x will suddenly be pointing to UUID "YYYYYY". Yes, it's true, it really happens, I see it all the time and it's why we have a policy NEVER to rescan the iSCSI LUN availability live.
-
Just an FYI, but from Ubuntu, the rsync (3.0.6) command throws an error: rsync: --sparse cannot be used with --inplace
-
Huh, that must have changed in a recent version. Sparse and inplace used to work. In any case, "inplace" is preferable for single files, "sparse" is preferable for directories of large files (say a MySQL DB).
