LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 02-27-2013, 05:56 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,133

Rep: Reputation: 45
External hard disk for backups


Dear all,
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
Regards
Alex
 
Old 02-27-2013, 07:53 AM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 13,524

Rep: Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806
I formatted my WD "my book" as ext4
and use usb
wrote a udev rule to mount it by the "name" and added a fstab entry

using udev will keep it on the same /dev/????
so it will be mounted
 
Old 02-28-2013, 02:32 AM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,133

Original Poster
Rep: Reputation: 45
I mostly meant for the parameters would be needed to format in a way sutiable for external hard disks.
 
Old 02-28-2013, 06:28 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Doesn't matter; a disk is a disk - John VV has pretty well covered things.
If you mount it with a name chosen by you, easy to check if it's mounted prior to using rsync.
 
Old 02-28-2013, 07:30 AM   #5
bloody
Member
 
Registered: Feb 2013
Location: Berlin
Distribution: Gentoo, Debian
Posts: 158

Rep: Reputation: 23
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...
 
Old 02-28-2013, 02:28 PM   #6
John VV
Guru
 
Registered: Aug 2005
Posts: 13,524

Rep: Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806
you might want to break it up into 3 or 4 partitions

just a safety precaution
1 Tb is still a large partition
 
Old 02-28-2013, 03:47 PM   #7
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
"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.
 
Old 02-28-2013, 04:03 PM   #8
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,624
Blog Entries: 1

Rep: Reputation: Disabled
wrt: c:
This should work, or something like it.
Code:
check_mount()
{
if 
mount | grep sdb1  > /dev/null ;
exit
else 
do_work_here
fi
}
HTH.
 
Old 03-02-2013, 05:39 AM   #9
BoraxMan
Member
 
Registered: Apr 2010
Posts: 84

Rep: Reputation: 8
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] changing GRUB from an external hard disk to the internal hard disk of my lap eco123 Linux - Newbie 2 05-15-2010 01:20 PM
Copy of IBM Server hard disk data to Another USB External Hard disk mazharcdn Linux - Server 2 09-02-2009 01:41 AM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 11:55 AM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration