Installing firmware on a new disk (Network space 2)

From NAS-Central Lacie Wiki
Jump to: navigation, search

Connect the new disk to a Linux PC. (A windows PC booted from a Linux Live CD or -usb stick is fine). You can use an USB-SATA converter, or connect the disk on an in- or extern SATA port.

Find the device name of the disk:

cat /proc/partitions

I'll assume the disk is sdb for the rest of the story.

Download mbr and all sdan.gz files here.

You'll need to have root rights to do the next steps. In Ubuntu or Knoppix you can get these by executing

sudo su

In most other flavors you just execute

su


Write mbr to disk:

dd if=/full/path/to/mbr of=/dev/sdb

Use fdisk to remove partition 2, and add it again. Primary partition. (your disk will have a different size than the mbr donor). Then add partitions 5-10 as specified here.

Note: as you can see the unit used in this partition table is cylinders of 8225280 bytes. If your fdisk shows units of sectors of 512 bytes, press 'u<enter>' to toggle units. If your fdisk shows cylinders of a different size press 'x<enter>' to toggle to 'expert' mode, and use 'h' and 's' to change the number of heads to 255, and the number of sectors per track to 63

fdisk is started by:

fdisk /dev/sdb

and use 'm' to get further help.
Write partitiontable and exit fdisk.

For the lazy people, the exact keystrokes in fdisk are:

d<enter>2<enter> (delete partition 2)
n<enter>p<enter>2<enter> (create new, primary, partition at slot 2)
<enter><enter> (default start- and endcylinder)
n<enter>l<enter>5<enter> (create new, logical partition 5)
<enter>32<enter> (default start cylinder (1) and endcylinder 32)
t<enter>5<enter>82<enter> (change partitiontype of 5 to swap)
n<enter>l<enter>6<enter> (create new, logical partition 6)
<enter>33<enter> (default start cylinder (33) and endcylinder 33)
n<enter>l<enter>7<enter> (create new, logical partition 7)
<enter>34<enter> (default start cylinder (34) and endcylinder 34)
n<enter>l<enter>8<enter> (create new, logical partition 8)
<enter>140<enter> (default start cylinder (35) and endcylinder 140)
n<enter>l<enter>9<enter> (create new, logical partition 9)
<enter>249<enter> (default start cylinder (141) and endcylinder 249)
n<enter>l<enter>10<enter> (create new, logical partition 10)
<enter> (default start cylinder (250) and endcylinder)
w<enter> (write changes and exit)

Copy all sdan.gz files to disk:

gzip -dc /full/path/to/sda6.gz | dd of=/dev/sdb6
gzip -dc /full/path/to/sda7.gz | dd of=/dev/sdb7
...

(when using sudo for root things, this should be

gzip -dc /full/path/to/sda6.gz | sudo dd of=/dev/sdb6
...

)

Create swappartition:

mkswap /dev/sdb5

Format partition 2:

mkfs -t xfs /dev/sdb2

When you put this disk in your Network Space 2, it should work.

It is possible that the filesystem on /dev/sda2 is not accepted by the NAS. In that case the shares are not visible/accessible, and you can't login on the webinterface (Please wait while loading ...). It seems that mkfs.xfs from modern distro's can generate an incompatible filesystem. The remedy: get shell access, login on the box, and create the filesystem here, and force unicorn to update:

mkfs.xfs /dev/sda2 -f
rm /etc/unicorn.db
reboot

It is also possible that the NAS boots, but doesn't show up in the network, and the blue led is blinking about once a second. In that case try a factory reset.

Note:

You may want to read this thread that describes an automated solution to do this.