Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I bought an external hard disk for doing my backups there.
The disk is 3TB large, and it would be used only for the backups.
a. Which is the recommended file system for external hard disk that should be accessible only from Linux? I do not want to bother with compression file systems
b. How should I mount it
c. Is it possible to check before my backup script runs (basically that would be some customized rsync) that the hard disk is indeed mounted and accessible (what would happen for example if the hard disk was present at boot time and someone accidentally remove the cable...for any reason)?
I would like to thank you in advance for your reply
a) ext4. Fastest and overall best allround file system for "Linux only".
b) maybe as one of the first commands in your backup script, because c) the mount would fail if not present at the very moment you launch the backup, so you would easily recognize and be able to echo ERROR and exit 1. Use a disk label to 100% identify the partition you want to mount. See man e2label. Use 16 characters max. for the label. In /etc/fstab, use e.g. "LABEL=MY_USB_BACKUP3" instead of "/dev/sdXN".
Another hint: 3TB is huge. If you only make it one large partition and got hardware trouble there, you might want to create an image of the defective partition for further analysis. But that doesn't just take ages, but also: where to store a 3TB file? Better make it 3x 1TB or 5x600GB...
"c. Is it possible to check before my backup script runs (basically that would be some customized rsync) that the hard disk is indeed mounted and accessible (what would happen for example if the hard disk was present at boot time and someone accidentally remove the cable...for any reason)?"
I'd say their may be a few ways to test target before script runs and use exit to some other means like write to log.
My guess would be to either test mount or test fstab. Might even go so far as to do test write to destination and read it back.
a) Ext 3 or Ext 4. XFS is also a decent choice. For my backup drive I use EXT4.
b) The way you mount any other disk.
c) I don't recommend looking for a specific device, such as /dev/sdb, because the device name might be different depending on whether other USB drives have been plugged in.
The best say I can think of, is to put a small file, with maybe a few bytes of random data and have a copy on the filesystem your backing up, and the one you are backing up to. Then, your script should just do a compare using cmp, and if it returns with no error, the drive is mounted.