NSLU2-Linux
view · edit · print · history

HowTo.CompletelyBackupTheNSLU2 History

Hide minor edits - Show changes to markup

October 10, 2009, at 08:58 PM by daer -- Note to edit in udev
Changed lines 65-66 from:
to:

Edit2: I had to edit /etc/udev/rules.d/70-persistent-net.rules to match new device MAC address

January 04, 2009, at 02:48 AM by lbenson -- wget link for windows added
Added lines 97-98:
(Windows users can also download gnu wget from http://users.ugent.be/~bpuype/wget/ Slick and scriptable.)
January 04, 2009, at 02:38 AM by lbenson -- Remove caps which created page links
Changed lines 70-77 from:
dd if=/dev/mtdblock0 > /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock1 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock2 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock3 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock4 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock6 >> /tmp/NSLU2C?_image.bin
(Don't know why the wiki is taking "NSLU2C?" as a link--ignore that.)
to:
dd if=/dev/mtdblock0 > /tmp/nslu2c_image.bin
dd if=/dev/mtdblock1 >> /tmp/nslu2c_image.bin
dd if=/dev/mtdblock2 >> /tmp/nslu2c_image.bin
dd if=/dev/mtdblock3 >> /tmp/nslu2c_image.bin
dd if=/dev/mtdblock4 >> /tmp/nslu2c_image.bin
dd if=/dev/mtdblock6 >> /tmp/nslu2c_image.bin
Changed lines 79-80 from:

This produces a file in tmp, NSLU2C?_image.bin, which is 8388608 bytes long, the size of the image which is flashed into the NSLU2. Note that the dds omit mtdblock5, which is a subset of mtdblock4--leaving it in produces an image which is too large.

to:

This produces a file in tmp, nslu2c_image.bin, which is 8388608 bytes long, the size of the image which is flashed into the NSLU2. Note that the dds omit mtdblock5, which is a subset of mtdblock4--leaving it in produces an image which is too large.

Changed lines 89-90 from:
<?php // GetNSimg?.php gets NSLU2 openWrt firmware image file
$Geturl = "http://192.168.1.77:82/NSLU2C_image.bin";
to:
<?php // getnsimg.php gets NSLU2 openWrt firmware image file
$Geturl = "http://192.168.1.77:82/nslu2c_image.bin";
Changed line 92 from:
$fh = fopen("NSLU2C?_image.bin", 'w') or die("Can't open file");
to:
$fh = fopen("nslu2c_image.bin", 'w') or die("Can't open file");
January 04, 2009, at 02:10 AM by lbenson --
Changed lines 78-79 from:
to:
(Note: I saw a suggestion that mtdblock4 should be made read-only before doing this, but the resulting image file was less than 8388608 megabytes--I didn't persue this.)
January 04, 2009, at 02:05 AM by lbenson --
Added lines 77-78:
(Don't know why the wiki is taking "NSLU2C?" as a link--ignore that.)
January 04, 2009, at 02:00 AM by lbenson --
Changed lines 66-67 from:

Backup Flash on NSLU2 running openWrt Kamikazi 7.09 (as of Jan 3, 2009)

to:

Backup Flash on NSLU2 running openWrt Kamikazi 7.09 (as of Jan 3, 2009)

Changed lines 70-76 from:

dd if=/dev/mtdblock0 > /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock1 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock2 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock3 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock4 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock6 >> /tmp/NSLU2C?_image.bin

to:
dd if=/dev/mtdblock0 > /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock1 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock2 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock3 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock4 >> /tmp/NSLU2C?_image.bin
dd if=/dev/mtdblock6 >> /tmp/NSLU2C?_image.bin
Changed lines 81-82 from:

/usr/sbin/httpd -p 82 -h /tmp -c /etc/httpd.conf

to:
/usr/sbin/httpd -p 82 -h /tmp -c /etc/httpd.conf
Changed lines 87-94 from:

<?php // GetNSimg?.php gets NSLU2 openWrt firmware image file

  $Geturl = "http://192.168.1.77:82/NSLU2C_image.bin";
  $A = file_get_contents($Geturl); 
  $fh = fopen("NSLU2C?_image.bin", 'w') or die("Can't open file");
  fwrite($fh,$A);
  fclose($fh);

?>

to:
<?php // GetNSimg?.php gets NSLU2 openWrt firmware image file
$Geturl = "http://192.168.1.77:82/NSLU2C_image.bin";
$A = file_get_contents($Geturl);
$fh = fopen("NSLU2C?_image.bin", 'w') or die("Can't open file");
fwrite($fh,$A);
fclose($fh);
?>
January 04, 2009, at 01:57 AM by lbenson -- Backup openWrt Kamikazi 7.09 flash
Changed lines 64-95 from:

Edit: I can confirm that this woks well for a Debian/LE NSLU

to:

Edit: I can confirm that this woks well for a Debian/LE NSLU

Backup Flash on NSLU2 running openWrt Kamikazi 7.09 (as of Jan 3, 2009)

This works to produce a backup of the flash which can be reflashed onto another (or the same) NSLU2 (no external device on this slug):

dd if=/dev/mtdblock0 > /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock1 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock2 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock3 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock4 >> /tmp/NSLU2C?_image.bin dd if=/dev/mtdblock6 >> /tmp/NSLU2C?_image.bin

This produces a file in tmp, NSLU2C?_image.bin, which is 8388608 bytes long, the size of the image which is flashed into the NSLU2. Note that the dds omit mtdblock5, which is a subset of mtdblock4--leaving it in produces an image which is too large.

Now how to get this file back on a Windows PC. There is probably a simpler way, but you can made the file available over http by running this:

/usr/sbin/httpd -p 82 -h /tmp -c /etc/httpd.conf

which makes port 82 available with the home directory of /tmp. This httpd.conf does not specify a password.

Then from the PC you can run this PHP program (php must be available).

<?php // GetNSimg?.php gets NSLU2 openWrt firmware image file

  $Geturl = "http://192.168.1.77:82/NSLU2C_image.bin";
  $A = file_get_contents($Geturl); 
  $fh = fopen("NSLU2C?_image.bin", 'w') or die("Can't open file");
  fwrite($fh,$A);
  fclose($fh);

?>

This image can then successfully be flashed (using the Sercomm upgrade utility or upslug2) onto a new NSLU2. You can access this NSLU2, change the ip address, and voila, a cloned openWrt 7.09 slug.

October 17, 2007, at 04:03 PM by Vasile --
Changed lines 62-64 from:
you are done!
to:
you are done!

Edit: I can confirm that this woks well for a Debian/LE NSLU

August 08, 2007, at 02:31 PM by fcarolo -- removed false wikilinks
Changed line 11 from:
0x00040000-0x00060000 : "SysConf?"
to:
0x00040000-0x00060000 : "SysConf"
Changed lines 19-20 from:

Reader's comment: Note that the following does not work with a Slug formatted with OpenDebianSlug?. Not sure what firmware this *does* work with, but it isn't OpenDebianSlug?. Anybody got ideas where these partitions are created in ODS?

to:

Reader's comment: Note that the following does not work with a Slug formatted with OpenDebianSlug. Not sure what firmware this *does* work with, but it isn't OpenDebianSlug. Anybody got ideas where these partitions are created in ODS?

August 08, 2007, at 05:27 AM by Klaus Ruebsam -- very very little spelling mistakes
Changed lines 41-42 from:

To recover your System to a brand new NSLU2 it's simpler to build a full image. The full image is simply the aggregation of our generated Files. To put them together you can use the "cat" command on your slug. Pay attention to the order of your files, it must be the same order as showen by your dmesg call. For the example above the command would be:

to:

To recover your System to a brand new NSLU2 it's simpler to build a full image. The full image is simply the aggregation of our generated Files. To put them together you can use the "cat" command on your slug. Pay attention to the order of your files, it must be the same order as shown by your dmesg call. For the above example the command would be:

March 08, 2007, at 09:51 PM by Nikolaus Klepp -- Added a comment
Added lines 21-22:

Other Reader's comment: The whole thing works perfectly well for me (OpenSlug 3.10).

January 19, 2007, at 11:46 AM by Mario Wolff --
Changed lines 47-60 from:

-unpack a new NSLU2 -plug power and network -power on -open 192.168.1.77 in your browser -select Administration -login with "admin"-"admin" -select Advanced -select Upgrade -click browse at upgrade file -select your fullimage.bin -click start upgrade -wait for success message -plug your old disk or stick -you are done!

to:
unpack a new NSLU2
plug power and network
power on
open 192.168.1.77 in your browser
select Administration
login with "admin"-"admin"
select Advanced
select Upgrade
click browse at upgrade file
select your fullimage.bin
click start upgrade
wait for success message
plug your old disk or stick
you are done!
January 19, 2007, at 11:42 AM by Mario Wolff -- recover section
Added line 43:

Recover

Changed lines 46-47 from:

Note: use UpSlug2 to restore the psrtitions.

to:

The fullimage.bin file is also usable with the Linksys-webgui! -unpack a new NSLU2 -plug power and network -power on -open 192.168.1.77 in your browser -select Administration -login with "admin"-"admin" -select Advanced -select Upgrade -click browse at upgrade file -select your fullimage.bin -click start upgrade -wait for success message -plug your old disk or stick -you are done!

January 19, 2007, at 10:13 AM by Mario Wolff -- recover
Added lines 38-45:

Build a simple recover Image

To recover your System to a brand new NSLU2 it's simpler to build a full image. The full image is simply the aggregation of our generated Files. To put them together you can use the "cat" command on your slug. Pay attention to the order of your files, it must be the same order as showen by your dmesg call. For the example above the command would be:

cat redboot.bin sysconf.bin kernel.bin ramdisk.bin flashdisk.bin fisdir.bin > fullimage.bin

You can recover with upslug2 by providing the fullimage.bin by parameter -i. In this case the redboot and sysconf data is *NOT* restored. If you have modified redboot or sysconf on your old system, you need to call upslug2 with -C. You need a Complete-reprogram-enabled version of upslug2!

January 15, 2007, at 01:40 PM by Jelle Alten -- typo
Changed line 38 from:

Note: use Upslug2? to restore the psrtitions.

to:

Note: use UpSlug2 to restore the psrtitions.

January 15, 2007, at 01:39 PM by Jelle Alten -- added Upslug2 note
Added lines 37-38:

Note: use Upslug2? to restore the psrtitions.

November 15, 2006, at 07:41 AM by Hockeyrink -- Alert regarding not working with a OpenDebianSlug install
Changed lines 17-18 from:

This lets you know there are 6 partitions in the flash. N.B. BE VERY CAREFUL with the following commands. A mistyped or bad command can literally erase or hose up your entire system. USE AT YOUR OWN RISK. First, MAKE SURE your current working directory is on the HD/FS. Then for each of the partitions do some similar to the following:

to:

This lets you know there are 6 partitions in the flash. N.B. BE VERY CAREFUL with the following commands. A mistyped or bad command can literally erase or hose up your entire system. USE AT YOUR OWN RISK.

Reader's comment: Note that the following does not work with a Slug formatted with OpenDebianSlug?. Not sure what firmware this *does* work with, but it isn't OpenDebianSlug?. Anybody got ideas where these partitions are created in ODS?

First, MAKE SURE your current working directory is on the HD/FS. Then for each of the partitions do some similar to the following:

August 30, 2006, at 02:59 PM by Egor Zindy -- completed the missing dd instructions and added memory addresses of the different mtdblocks
Changed lines 10-15 from:
0x00000000-0x00040000 : "RedBoot" ....
to:
0x00000000-0x00040000 : "RedBoot"
0x00040000-0x00060000 : "SysConf?"
0x00600000-0x00160000 : "Kernel"
0x00160000-0x00180000 : "Ramdisk"
0x00180000-0x007e0000 : "Flashdisk"
0x007e0000-0x00800000 : "FIS directory"
Changed lines 17-18 from:

This lets you know there are 6 partitions in the flash. N.B. BE VERY CAREFUL with the following commands. A mistyped or bad command can literally erase or hose up you're entire system. USE AT YOUR OWN RISK. First, MAKE SURE your current working directory is on the HD/FS. Then for each of the partitions do some similar to the following:

to:

This lets you know there are 6 partitions in the flash. N.B. BE VERY CAREFUL with the following commands. A mistyped or bad command can literally erase or hose up your entire system. USE AT YOUR OWN RISK. First, MAKE SURE your current working directory is on the HD/FS. Then for each of the partitions do some similar to the following:

Changed lines 22-24 from:

Continue this all the way through mtdblock5 or how many partitions one has. Note: Since we started at 0, the mtdblock number will be 1 less than the total number.

to:
dd if=/dev/mtdblock3 of=ramdisk.bin
dd if=/dev/mtdblock4 of=flashdisk.bin
dd if=/dev/mtdblock5 of=fisdir.bin

Issue "dd" commands all the way through to mtdblock5 or how many partitions one has. Note: Since we started at 0, the mtdblock number will be 1 less than the total number.

August 22, 2005, at 03:16 PM by tman --
Added lines 1-24:

How do I completely backup my NSLU2?

There are several parts to this answer. First get root access as noted above for the stock Linksys or other places for Unslung or Openslug. Next you will need to backup all the partitions from the flash and the hard driver/flash stick. A recommendation is to backup the flash onto the hard drive/flash stick first, then when one backs up the hard drive/flash stick (HD/FS) you'll have both.

At the root prompt, type "dmesg" to get a printout of the console of the kernel messages during boot. Search in there for something like the following:

Searching for RedBoot partition table in IXP4XX-Flash0 at offset 0x7e0000
6 RedBoot partitions found on MTD device IXP4XX-Flash0
Creating 6 MTD partitions on "IXP4XX-Flash0":
0x00000000-0x00040000 : "RedBoot" ....

This lets you know there are 6 partitions in the flash. N.B. BE VERY CAREFUL with the following commands. A mistyped or bad command can literally erase or hose up you're entire system. USE AT YOUR OWN RISK. First, MAKE SURE your current working directory is on the HD/FS. Then for each of the partitions do some similar to the following:

dd if=/dev/mtdblock0 of=redboot.bin
dd if=/dev/mtdblock1 of=sysconf.bin
dd if=/dev/mtdblock2 of=kernel.bin

Continue this all the way through mtdblock5 or how many partitions one has. Note: Since we started at 0, the mtdblock number will be 1 less than the total number.

Note: the block number start with 0. This provides you with a binary copy of the contents of the individual paritions in flash. Next, you will need to properly shutdown and power off the NSLU2 to backup the contents of the HD/FS. This is most easily performed on another system. I'd recommend getting a copy of ubuntu or knoppix and running from the livecd if you don't have access to Linux/Unix system.

On that Linux/Unix system, one needs to plug in the NSLU2 hard drive/flash stick, I'd suggest mounting the partitions read only, and tar up the partitions and save off a copy of the MBR (master boot record -- this contains the partition table on the disk itself). With this data, a disk of equal or greater size can be restored to. Note: Restoring to a larger disk will mean the extra space is not utilised. When done shutdown properly and reattach the HD/FS to the NSLU2.

Finally, as long as RedBoot isn't toasted, you can reload and restore the flash partitions. If RedBoot is toasted, then you'd need to do hardware modifications to get JTAG access to restore RedBoot or another boot loader to the flash and then be able to restore everything.

view · edit · print · history · Last edited by daer.
Based on work by lbenson, Vasile, fcarolo, Klaus Ruebsam, Nikolaus Klepp, Mario Wolff, Jelle Alten, Hockeyrink, and Egor Zindy.
Originally by tman.
Page last modified on October 10, 2009, at 08:58 PM