arkam
New Member
Posts: 13
|
Post by arkam on May 31, 2007 13:47:36 GMT 7
Hi, I am writing a shell script to backup my raid on an usb hdd. With my first test he script took more than 8 hours to complete (for 80GB from /raid to usb) !!!!!!! Can someone explain this ? Is this USB1 (High Speed) only ? -> the backup is done with RSYNC Can someone tell me how mount works with usb drives ? Thanks, Arkam
|
|
|
Post by quick on Jun 1, 2007 0:54:16 GMT 7
It is possible to do things very stupid in a shell-script. However I am not say you have done it like that But could you outline what your shell-script is doing or even better post the copy-part of it. What is your normal read-speed from your N5200 over the network?
|
|
glo8al
Junior Member
Posts: 95
|
Post by glo8al on Jun 5, 2007 18:00:34 GMT 7
How is this going? I was looking at using a external USB for a second backup option. Or is there another way of doing this, or is a shell script the only way? edit: or eSATA drive?
|
|
jamis
Full Member
Posts: 109
|
Post by jamis on Jun 13, 2007 7:27:11 GMT 7
I just managed to set this up with an external USB hard disk (formatted ext3).
My script looks something like this (excuse the lack of whitespace/indentation.. the code tags aren't showing it properly):
#!/bin/sh
mounted=`mount | grep "/dev/sdf1 on /raid/data/usbhdd/sdf1 type ext3 (rw)" | wc -l`
if [ $mounted == 1 ] then echo "/dev/sdf1 is mounted; updating backup..." else echo "/dev/sdf1 is not mounted; attempting to mount." mount /dev/sdf1 /raid/data/usbhdd/sdf1
if [ $? == 0 ] then echo "/dev/sdf1 mounted successfully; proceeding with backup..." else echo "/dev/sdf1 could not be mounted. Aborting." exit 1; fi
fi
cp -vrfu /raid/data/public/* /raid/data/usbhdd/sdf1/public/
Assumptions and notes:
1. The usb drive will/should always be sdf1 in my environment 2. i am only backing up the contents of the 'public' folder (recursively) 3. the 'u' option to the cp command will cause only updated files to be backed up. An incremental backup of sorts. :)
|
|
jamis
Full Member
Posts: 109
|
Post by jamis on Jun 13, 2007 7:39:52 GMT 7
As for speed and usb drives in general, I am getting very good speeds (USB 2.0) with the USB drive attached to the back USB ports.
As for how I set it up:
1. Installed SSHD and SYSUSER modules on N5200
2. Installed USB HDD using one of the back USB ports
3. My system automatically mounted the USB disk and it appeared using the df command.
4. I unmounted the USB disk and used fdisk on the device: fdisk /dev/sdf1
5. I deleted all partitions, and created one big one of type Linux (83). I wrote the partition table, exited fdisk
6. I formatted the disk: mke2fs -j /dev/sdf1 (-j uses ext3 instead of ext2)
And thats it. Every time the drive is plugged in it should automatically mount to /raid/data/usbhdd/sdf1 (at least this is where it mounted on my system). I'm not sure how it would behave if I had more than one USB drive which could be plugged in (or not) at any given time.
One last note:
If you leave your USB drive attached and mounted, it will appear in your usbhdd folder and by default, publicly browse-able. Make sure you have the usbhdd ACL set up properly if you are backing up private directories.
|
|