Upgrade (or replace) the existing LinkStation hard drive

This article based on work by DC and frontalot. Originally by frontalot at Linkstationwiki.org Some of this information courtesy of http://www.geishuettner.de/docs/Linkstation/

=Old Generation - LS1,LS2,HG,HS=

Methods - There are two ways to go about this:


 * You will have to backup the data, if you want to save it in /mnt on your own with either method.
 * Disassemble the LinkStation and disconnect the hard drive.


 * 1) Use the Firmware updater to create partitions and flash the firmware This is generally accepted as the easier method to upgrade your Linkstation's hard drive, if you run the firmware updater it will automatically create the necessary partitions. When you boot the LS up for the first time, the disk full LED will flash, this is the LS creating the partitions, wait until the flashing stops, then run the firmware updater (you may need to run it twice as the first may fail).
 * 2) Backup your entire hard drive, partition a blank drive on a Knoppix workstation These instructions are intended for people who wish to preserve their existing /hda1. First you will need to Create a perfect backup of the LinkStation filesystem then partition a new hard drive on a Knoppix workstation. Finally you will have to restore the backup you created and create a swap partition.

Backup Data
Backup the data in /mnt that you want to save either by copying it off of your LinkStation using Samba, FTP or a USB drive. You could create a Tarball of this data if you wanted to.

Then take the old drive out of the LinkStation and put the new drive in. Make sure, it the jumper is set to "Master".

Restore your Data
Restore your data by the reverse of what you did to back it up: Transfer the data back using Samba, FTP or a USB drive. And untar the Tarball of this data if you created one.

Backup Data and /hda1

 * Start by making a backup of your existing hard drive: Create a perfect backup of the LinkStation filesystem.
 * Backup the data in /mnt that you want to save either by copying it off of your LinkStation using Samba, FTP or a USB drive. You could create a Tarball of this data if you wanted to.

Download Knoppix
Download a Knoppix bootable Linux CD (see Knoppix or possibly Damn Small Linux(not tried)), place the new hard drive in a workstation, and boot using the Knoppix CD.

Partition Hard Drive
Now you need to partition the new hard drive according to your needs (replacing  x  with whatever letter you have installed the hard drive as): fdisk /dev/hd x The standard LinkStation setup uses 3 partitions: If you want a larger main partition you should do so at this time.
 * hda1 (main ~ 400MB)
 * hda2 (swap ~ 300MB)
 * hda3 (mount ~ remaining)

Restore your backup of /hda1
Restore your backup first dd if=/mnt/whatever/hda1.bin of=/dev/hda1 You must run fix_ext2_magic, check for errors, and resize the backup image if you created a larger main partition: ./fix_ext2_magic --fix /dev/hdx1 e2fsck /dev/hdx1 resize2fs /dev/hdx1 You may have to use the force option (-f) if resize2fs complains about not running e2fsck.

Create the ext2 filesystem and swap partition
You can turn off drive checking since we are using ext2 with journaling: mke2fs -j /dev/hdx3 tune2fs -c0 -i0 /dev/hdx3 mkswap /dev/hdx2

Reboot
Place the new hard drive in the LinkStation and reboot. Be patient as the first boot may take longer than normal.

Restore your Data
Restore your data by the reverse of what you did to back it up: Transfer the data back using Samba, FTP or a USB drive. And untar the Tarball of this data if you created one.

=New Generation - LSPro,LSLive=

There are several ways, but it is not that easy as with the older boxes. Just putting in a blank drive and updating the firmware does not work as the Firmware updater does not find the box. Why? Because in contrast to the older boxes everything but the bootloader(UBoot) is on the hdd. so even EM Mode got implemented via an initrd in /boot (=/dev/sda1).

Cloning the first partition and flashing
This way works because you need the first partition (/boot = /dev/sda1) so you can boot to EM Mode
 * 1) Follow Disassemble_the_LS_Pro until you have the hdd in your hand
 * 2) Connect the HDD to a pc, also connect the new HDD to it.
 * 3) clone /dev/sda1 from the old to the new HDD
 * 4) Assemble the LSPro/LSLive again with the new HDD
 * 5) Flash the Firmware of your choice or Build custom partitions on the box
 * 6) Note - if you are flashing firmware, you may need to go into Debug mode and select the option to rebuild the partition table (click on the 2 yellow circles on the top left of the LSUpdater screen and select Debug from the menu).

Advantages

 * Easy, no Linux Skills needed (if you use Norton Ghost for example)

Disadvantages

 * None currently