Re: I need to clone my working nslu2
- I was sure someone else would answer this. I was looking in the Wiki for the procedure I used a couple of times as I upgraded from a 250GB to a 500Gb and then a 1Tb system volume. Unfortunately, I can't seem to find that any more. However, this procedure seems to be exactly what you are looking for:
- http://www.cyrius.com/debian/nslu2/clone.html "How to clone a NSLU2"
Timothy C Litwiller wrote:
> I have a nslu2 that I setup 3 years ago. It has been working flawlessly
> for the entire time.
> It reads the data from my davis vantageII weather station anduploads it
> to aprs and wunderground.com every 2 minutes.
> I want to make an exact duplicate and then edit several settings to do
> this to another weather station.
> I've tried to do a backup a year or so ago - but when restored to a new
> nslu2 it didn't work.
> Now I worry that if anything ever went wrong with mine I couldn't get it
> running again without researching the whole process again.
> Is there any method that will do a complete backup and restore of the
> nslu2 and the 2Gb USB drive or a method to do a complete clone from one
> setup to another?
- I would use these instructions with a grain of salt. One needs to be careful that TAR does not exactly duplicate file systems. Older versions of TAR had the limit of 255 characters for the path length so it wasn't uncommon to see whole directory trees missing... GNU tar solves that problem, but there are still other problems to be concerned about. First off, tar does not preserve either file system holes, file attributes, nor ACL's. There is a --sparse flag you can add to the tar command which will sort of preserve file system holes. I say sort of, because what it really does is create new holes that hopefully match the old ones.
If you do not use the correct tags with tar you can also lose other information such as last access time, permissions, and owners. In general if I see any document where the person recommends this method of copying file systems without at least mentioning the caveats, I ignore everything and look something written by someone who knows what they are doing.
Now you might ask, if you shouldn't use tar, what should you use? Well if you don't mind the caveats above go head and use tar. Many people prefer CPIO, however that also has some limitations to be wary of. As does 'cp -a', ... My personal favourite is rsync. Once you figure out the correct flags not only will it copy everything but it will verify the copy. If your copy gets interrupted, it will figure out where to resume the next time you use it. However, this comes at a cost. rsync takes ruffly twice as long.
If I am copying a whole filesystem, I usually use 'dd bs=4096' on the raw devices. This works wonderfully, if and only if your old hard drive have ruffly the same mapping. However, this seems to be true nearly 100% of the time now days. After you copy the raw file system, you can resize it to the new partition size with resize2fs. You'll want to run e2fsck after you are done to verify you have a good copy.
--- In firstname.lastname@example.org, "Robert D" <robert.dammers@...> wrote:
> I was sure someone else would answer this. I was looking in the Wiki for the procedure I used a couple of times as I upgraded from a 250GB to a 500Gb and then a 1Tb system volume. Unfortunately, I can't seem to find that any more. However, this procedure seems to be exactly what you are looking for:
> Good luck!