DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#151 2008-07-14 18:56:57

halfsoul
Member
Registered: 2008-01-28
Posts: 57

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

greg,
I recently had a Vol1 drive fail.  My recovery procedure was as follows (with power-cycles in between each step):
1. remove bad Vol1 & good Vol2, insert new Vol1 in RHS
2. format new Vol1
3. insert old Vol2 in LHS
4. copy fun_plug script to Vol1 (I run fun_plug off USB, so all I needed was the file to call it)
5. copy data from Vol2 to Vol1

I too wish it were as simple as putting the Vol2 drive in the RHS, but alas... 'tis not.

the only tricky thing is to make sure your copy command is recursive and preserves attributes.  In order to put all of your data from the Vol2/HD_a2/ folder to the root of Vol1... you need to start in the Vol2/HD_a2/ folder and copy *.* recursively.  If you define a source directory then the destination (Vol1) will also have said sorce directory as a subdir.  <-- BTW, this is the same reason your Vol2 has a /HD_a2/ subdir instead of retaining the same root folder structure.

Offline

 

#152 2008-07-14 23:10:51

ClipOn
Member
Registered: 2008-05-24
Posts: 8

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Hello,

From a Windows box, you can also want to use RoboCopy, like this:

robocopy.exe \\DNS-xxxx\Volume_1 \\DNS-xxxx\Volume_2 *.* /E /Z /XD .systemfile [/MIR]

and schedule it. Not in block mode, through the LAN, but so easy to configure ! WARNING: use /MIR option very carefully, may erase all your data...

RoboCopy is now part of Vista or Windows 2008, and available for older version in ResKit.

HtH


DNS-323  1.07  1To+1,5To     Samsung SpinPoint F1       No Raid   No Backup
DNS-323  1.07  1To+1,5To     Samsung SpinPoint F1       No Raid   Backup DNS to DNS via LAN each month with Robocopy

Offline

 

#153 2008-07-15 04:34:53

greg
Member
Registered: 2008-07-04
Posts: 6

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

halfsoul wrote:

greg,
I recently had a Vol1 drive fail.  My recovery procedure was as follows (with power-cycles in between each step):
1. remove bad Vol1 & good Vol2, insert new Vol1 in RHS
2. format new Vol1
3. insert old Vol2 in LHS
4. copy fun_plug script to Vol1 (I run fun_plug off USB, so all I needed was the file to call it)
5. copy data from Vol2 to Vol1

I too wish it were as simple as putting the Vol2 drive in the RHS, but alas... 'tis not.

the only tricky thing is to make sure your copy command is recursive and preserves attributes.  In order to put all of your data from the Vol2/HD_a2/ folder to the root of Vol1... you need to start in the Vol2/HD_a2/ folder and copy *.* recursively.  If you define a source directory then the destination (Vol1) will also have said sorce directory as a subdir.  <-- BTW, this is the same reason your Vol2 has a /HD_a2/ subdir instead of retaining the same root folder structure.

Thanks!  The more I started thinking about it, this seems to be the only way to go.  I guess it's time to order that 3rd drive and just have it on hand for when one of the others fails.

Offline

 

#154 2008-07-15 16:59:55

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

greg wrote:

I guess it's time to order that 3rd drive and just have it on hand for when one of the others fails.

Having a 3rd drive is a very good idea, but make sure that you format it BY ITSELF before using it.  And if possible, make an extra backup copy of your most critical files on a separate device before attempting the restore.  As discussed elsewhere, the DLink has a well-documented habit of formatting both drives when it's purporting to format only the freshly-inserted blank drive.  When your main drive fails, your backup becomes your only copy until you get your setup back to normal!

I myself am setting up a VolA(plus workstations)-to-VolB backup plan - in our case, it will be manually triggered once or twice a week, since we don't do anything noteworthy on our systems most days, and no longer leave them on overnight.  (oh, I forgot to mention I'm mounting read-only NFS shares from each desktop computer onto the DLink itself, and then made the 2nd drive NOT shared to the network, so I can do everything inside the server with minimal complications and maximum safety)
But I want to be able to swap out the Volume_2/sdb drive periodically for an offsite backup too.  And having been bitten by the "format both drives" bug SO often now, I've actually bought yet another (4th) drive for experimentation without risking my main setup. 

So far I've been unable to get consistently reilable results when it comes to swapping drives around under various circumstances, though.  User bq041 has posted about investigating how the DNS-323 stores drive serial numbers in non-volatile RAM, possibly in an attempt to recognize re-inserted devices, but if he's posted final results I haven't come across them.

Offline

 

#155 2008-07-17 16:42:44

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

From February 2008:

blbrown wrote:

Dexter Tones wrote:

I followed the tutorial and everything went smoothly. However, I was looking at the rsync FAQ and it says that one should "expect rsync to consume about 100 bytes per file" to "hold the list of files being transferred."

[...]

2. Wait until rsync (http://samba.anu.edu.au/rsync/) version 3.0 is complete and someone (fonz?) compiles it for the DNS-323.  Version 3 addresses this specific issue and it's currently in pre-release which gives me hope it will be complete some time soon.

I see that ffp v0.5 beta has a 3.0+ rsync package; does this mean the above user's hope is fulfilled and rsync is now memory-efficient enough to handle - for instance - a backup of half a million + files?

I've been sticking to fun_plug 0.4 until 0.5 leaves beta, but may upgrade sooner if it will give me the ability to do the copy without the enormous slowdown I encounter for the last 5% or so of the files on my wife's Mac Mini OSX root partition.  However, I don't see anything in the wiki or here on the forums which addresses this issue (perhaps because it probably doesn't affect very many people...) so I'm missing a term in my risk-reward calculation!

Offline

 

#156 2008-07-17 17:29:42

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

bscott wrote:

I've been sticking to fun_plug 0.4 until 0.5 leaves beta

May take a few more months. Afaict, current 0.5 works as well as 0.4, maybe better. If you keep a backup of your fun_plug script, it's also easy to revert to 0.4, since 0.5 won't overwrite any of the files (except the fun_plug script).

Still, 0.5 is quite different and it may take some time to get used to it. The documentation on the wiki ( http://dns323.kood.org/howto:ffp ) should you started.

PS: I don't have a car. Thanks, anyway.

Offline

 

#157 2008-07-17 17:34:36

blbrown
Member
Registered: 2007-11-02
Posts: 88
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

bscott wrote:

From February 2008:

blbrown wrote:

Dexter Tones wrote:

I followed the tutorial and everything went smoothly. However, I was looking at the rsync FAQ and it says that one should "expect rsync to consume about 100 bytes per file" to "hold the list of files being transferred."

[...]

2. Wait until rsync (http://samba.anu.edu.au/rsync/) version 3.0 is complete and someone (fonz?) compiles it for the DNS-323.  Version 3 addresses this specific issue and it's currently in pre-release which gives me hope it will be complete some time soon.

I see that ffp v0.5 beta has a 3.0+ rsync package; does this mean the above user's hope is fulfilled and rsync is now memory-efficient enough to handle - for instance - a backup of half a million + files?

I've been sticking to fun_plug 0.4 until 0.5 leaves beta, but may upgrade sooner if it will give me the ability to do the copy without the enormous slowdown I encounter for the last 5% or so of the files on my wife's Mac Mini OSX root partition.  However, I don't see anything in the wiki or here on the forums which addresses this issue (perhaps because it probably doesn't affect very many people...) so I'm missing a term in my risk-reward calculation!

My personal feelings are that ffp 0.5 has been in beta long enough to consider it stable.  I'll be moving to it when I get the time.  On the other hand, rsync has undergone some bug fixes since the initial 3.0.0.  Perhaps Fonz can build version 3.0.3?

I'd like to hear your experience with rsync version 3+ since you might be one of the few people that has actually seen earlier versions really bog down due to transferring so many files.

Offline

 

#158 2008-07-17 17:53:19

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

blbrown wrote:

Perhaps Fonz can build version 3.0.3?

Here you are.
http://www.inreto.de/dns323/fun-plug/0. … .0.3-1.tgz

Offline

 

#159 2008-07-18 05:49:30

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

fonz wrote:

May take a few more months. Afaict, current 0.5 works as well as 0.4, maybe better. If you keep a backup of your fun_plug script, it's also easy to revert to 0.4, since 0.5 won't overwrite any of the files (except the fun_plug script).

OK, that's clear enough - no point in waiting a few more days/weeks then.  I've just had so much trouble with my -323 lately (nothing due to fun_plug of course) that I'm leery about doing almost anything these days...

blbrown wrote:

I'd like to hear your experience with rsync version 3+ since you might be one of the few people that has actually seen earlier versions really bog down due to transferring so many files.

Well actually, it was "cp -a" - started out at 5-6 megs per second (over gig-ethernet NFS) but slowed to 1-2 megs per minute after several hours, and I finally killed the job after well over a day when it had reached what I'd calculated to be roughly the full backup amount but was still creeping along.  I was only trying to create an initial backup fileset, to have *something* in place before taking the step of getting rsync set up properly for automating future backups.  I reckoned a future rsync could fill in whatever the killed job had left to do, and/or be faster recreating the full set in the first place. 

I had originally looked into the "Time Machine"-esque schemes mentioned here and elsewhere, before realizing it was a lot more capability than I wanted or could use.  So I was reading up on rsync in general, to determine which options were best for my needs (and bear in mind that with a 9-5 job, a 2-year old at home, and the wife working evenings and weekends, sometimes I have as little as 20 mins a day to futz around on the computer...)   

But I will post if/when I try it and observe anything noteworthy.

Offline

 

#160 2008-07-21 08:09:58

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

blbrown wrote:

I'd like to hear your experience with rsync version 3+ since you might be one of the few people that has actually seen earlier versions really bog down due to transferring so many files.

I upgraded to FFP 0.5 this weekend and ran rsync over all the backups I'd originally generated using cp, and things went quite smoothly.  The 550,000+ files on my wife's OSX root partition (which were not all copied on the first run, but certainly most were) updated in about 20 minutes, the rest far less.  No memory problems on the 323, in stark contrast to using "cp -a".

Of course, it turns out I don't have a good way to restore this backup to an HFS-formatted drive (while maintaining file ownership), and I've yet to test restoring the Ubuntu backups but my pessimism tells me to expect problems there too... but backing up the 323 drive-to-drive works fine, thankyouverymuch!

Offline

 

#161 2008-07-22 03:26:57

halfsoul
Member
Registered: 2008-01-28
Posts: 57

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

OK, I have a question.  Does the rsync folder structure behavior mimic that of cp?  Specifically, if I were to change the crontab entry to this:

Code:

/bin/echo "5 2 * * * /mnt/HD_a2/fun_plug.d/bin/rsync -rlptDv --delete /mnt/HD_a2/* /mnt/HD_b2 >> /mnt/HD_a2/fun_plug.d/log/rsync.last.log 2>&1" >> $CRONTXT

(changing the source from "/mnt/HD_a2/" to "/mnt/HD_a2/*")

then would it mirror Vol 1 to Vol 2 without the HD_a2 directory at the root of Vol 2?

The goal here would be to make recovery much faster -- just move the good backup drive from LHS to RHS and you're done.

Offline

 

#162 2008-07-22 12:25:11

kruzes
Member
Registered: 2007-05-31
Posts: 22

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

halfsoul wrote:

OK, I have a question.  Does the rsync folder structure behavior mimic that of cp?

Yes, except that won't backup hidden files on the HD root.

Offline

 

#163 2008-10-03 01:11:35

Chumby
Member
From: Tasmania, Australia
Registered: 2007-08-01
Posts: 96
Website

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Nurunet.... this may help you get started...

Cheers,
Chumby

Offline

 

#164 2008-10-03 19:22:07

WildSioux
Member
Registered: 2007-03-05
Posts: 71

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Chumby...

I recently updated funplug to version 0.5.  I installed your backup script again only changing the directories to "/ffp/"

Even though it shows the script is installed using "crontab -l" Its not working though.  I checked my volume 2 (b2) drive, and it didn't copy the changes I have made.  It is still showing the "fun_plug.d" directory.

Is there something I am missing?  Thanks

Offline

 

#165 2008-10-05 20:43:56

nurunet
Member
From: Germany
Registered: 2008-08-31
Posts: 44

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

vi didn't work for me, I couldn't exit it. So I created the editcron.sh with Notepad++, saved it to /mnt/HD_a2/usbstorage/, then ('cause I ain't got write permission in the ffp directory from Windows) moved it via SSH (Putty) with mv to /mnt/HD_a2/usbstorage/ffp/start/editcron.sh. Yes, I adapted the paths.

Then I chmodded the file, rebooted the NAS and after that, a crontab -l showed exactly... nothing. Not even the three tasks that should have been there anyway, if I read correctly. In the ffp.log, I found this:

/ffp/etc/rc: line 45: /ffp/start/editcron.sh: not found

It does exist. What am I doing wrong? Where are my cron jobs?


Conceptronic CH3SNAS FW 1.03, ffp from USB key.

Offline

 

#166 2008-10-05 20:52:30

nurunet
Member
From: Germany
Registered: 2008-08-31
Posts: 44

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Ooops. Seems I had to install bash for shell scripts? I'll try the crontab after e2fsck has run through.


Conceptronic CH3SNAS FW 1.03, ffp from USB key.

Offline

 

#167 2008-10-05 22:08:24

3rdparty
Member
Registered: 2008-04-19
Posts: 20

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

What is the easiest way to manually trigger the rsync (including logging)?   I don't always leave my box on and want to be able to manually set the backup to start.

Also, is there a way to have the log time/date stamp each line?

thanks

Last edited by 3rdparty (2008-10-05 22:10:34)

Offline

 

#168 2008-10-06 00:13:31

nurunet
Member
From: Germany
Registered: 2008-08-31
Posts: 44

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

I still get the following in the ffp.log:

* /ffp/start/editcron.sh ...
/ffp/etc/rc: line 45: /ffp/start/editcron.sh: not found

I can start the job with

sh editcron.sh

Why doesn't it run automatically? And why are there no other active cron jobs?

Here's the whole log:

**** fun_plug script for DNS-323 (2008-08-11 tp@fonz.de) ****
Sun Oct  5 22:27:54 GMT 2008
* Running /mnt/HD_a2/.bootstrap/setup.sh ...
**** ffp 0.5 usb-setup by wolf-u.li ****
Found usb-storage.ko module.
insmod usb-storage.ko
Mounting /dev/sdc1 on /mnt/HD_a2/usbstorage ...Success
* Found FFP on USB device
ln -snf /mnt/HD_a2/usbstorage/ffp /ffp
* Running /ffp/etc/fun_plug.init ...
* Running /ffp/etc/fun_plug.local ...
    mode:         16384
-o  offset:       0
-f  frequency:    0
    maxerror:     16384000
    esterror:     16384000
    status:       64 (UNSYNC)
-p  timeconstant: 2
    precision:    1
    tolerance:    33554432
-t  tick:         9965
    time.tv_sec:  1223242089
    time.tv_usec: 714754
    return value: 5 (clock not synchronized)
* Running /ffp/etc/rc ...
* /ffp/start/syslogd.sh inactive
* /ffp/start/SERVERS.sh inactive
* /ffp/start/portmap.sh inactive
* /ffp/start/unfsd.sh inactive
* /ffp/start/nfsd.sh inactive
* /ffp/start/ntpd.sh ...
Starting /ffp/bin/ntpd -g -f /ffp/etc/ntp.drift
* /ffp/start/smartd.sh inactive
* /ffp/start/LOGIN.sh inactive
* /ffp/start/telnetd.sh inactive
* /ffp/start/sshd.sh ...
Starting /ffp/sbin/sshd
* /ffp/start/rsyncd.sh inactive
* /ffp/start/mediatomb.sh inactive
* /ffp/start/kickwebs.sh inactive
* /ffp/start/lighttpd.sh inactive
* /ffp/start/inetd.sh inactive
* /ffp/start/editcron.sh ...
/ffp/etc/rc: line 45: /ffp/start/editcron.sh: not found
*  OK

Last edited by nurunet (2008-10-06 00:32:17)


Conceptronic CH3SNAS FW 1.03, ffp from USB key.

Offline

 

#169 2008-10-08 22:14:14

nurunet
Member
From: Germany
Registered: 2008-08-31
Posts: 44

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

I think I messed up the vi part. I created the editcron.sh with nano, and now it works. Still, rsync is the only cronjob under crontab -l. Where are the others?

One more question. I looked at the log of the first backup operation, and it said:

sent 67446261675 bytes  received 114772 bytes  2476686.92 bytes/sec
total size is 470895637389  speedup is 6.98

Why did it receive any data? The target directory was supposed to be empty.


Conceptronic CH3SNAS FW 1.03, ffp from USB key.

Offline

 

#170 2008-10-15 15:20:37

nurunet
Member
From: Germany
Registered: 2008-08-31
Posts: 44

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Okay, I guess halfsoul explained why everything is copied to the subfolder "HD_a2" on Volume_2. Anyway, I didn't understand. I'd rather prefer to have the data in Volume_2's root. Would that be possible, and what would I have to do to accomplish that?


Conceptronic CH3SNAS FW 1.03, ffp from USB key.

Offline

 

#171 2008-10-15 18:01:04

halfsoul
Member
Registered: 2008-01-28
Posts: 57

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

nurunet wrote:

Okay, I guess halfsoul explained why everything is copied to the subfolder "HD_a2" on Volume_2. Anyway, I didn't understand. I'd rather prefer to have the data in Volume_2's root. Would that be possible, and what would I have to do to accomplish that?

I haven't tried it yet to verify if it works, but you should be able to change your crontab source and destinations to "/mnt/HD_a2/* /mnt/HD_b2" to get the backup to the root directory.  Care to be a guinea pig and report if it works?

Offline

 

#172 2008-10-20 22:24:41

BobbyCarbn
Member
Registered: 2008-09-26
Posts: 14

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

nurunet: Any luck with copying everything to the Root of Volume_2?

Offline

 

#173 2008-10-21 00:10:48

nurunet
Member
From: Germany
Registered: 2008-08-31
Posts: 44

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Well, I managed to move all the folders from the HD_a2-directory to Volume_2's root... except for the hidden system folders (.bootstrap and .systemfile). I didn't dare to move them manually, fearing a .bootstrap on the second drive might get me into trouble, just like overwriting the .systemfile that already existed on Volume_2 maybe could.

To cut a long story short: I chickened out. :-(

Good news though, that I could move the contents of HD_a2 with a simple

Code:

mv /mnt/HD_b2/HD_a2/* /mnt/HD_b2/

(IIRC). It only took a moment.

Maybe I'll have the guts to try this anyway next weekend, but as I've got nearly 500 GB of data on my disks, I'd hate to mess with them too much...

Last edited by nurunet (2008-10-21 00:11:52)


Conceptronic CH3SNAS FW 1.03, ffp from USB key.

Offline

 

#174 2008-10-21 22:51:59

BobbyCarbn
Member
Registered: 2008-09-26
Posts: 14

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

Hey guys, I need some help in quick fashion.  I installed the crontab job with no problem and it kicked off as expected at 205am.  Problem is, I am using rsync to copy over 800GB of data.  Its moving pretty slow and its only moved about 400gb thus far.  I am worried what will happen if its not done with the initial copy when the crontab schedule kicks in again at 205am tomorrow.  Is there a way to pause this crontab until the initial copy is completed?

Thanks
BC

Offline

 

#175 2008-10-22 04:46:17

BobbyCarbn
Member
Registered: 2008-09-26
Posts: 14

Re: Tutorial: Backup Everything from Vol A to Vol B once a night

I figured it out,  here is what I did.

Code:

 crontab -e

That brought up vi.  Then hit 'a' to enter edit mode, tab down and change the rsync job that was scheduled to run at 2:05am to run at 4:05pm.

Code:

 
32 2 * * * /usr/sbin/rtc -s
30 2 2 * * /usr/sbin/rtc -c
59 1 * * * /usr/sbin/daylight &
5 16 * * * /mnt/HD_a2/ffp/bin/rsync -rlptDv --delete /mnt/HD_a2 /mnt/HD_b2 >> /mnt/HD_a2/ffp/log/rsync.last.log 2>&1

The 5 16 is what tells it to go off at 4:05pm

You then hit 'esc' to exit edit mode and then ':wq' to save and exit.

Run 'crontab -l' to check the time was changed and you are good to go.

Last edited by BobbyCarbn (2008-10-22 08:07:09)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB