Resizing the system partition with parted magic live cd

= About = If you installed any custom firmware of your choice you might soon run into some problems because you do not have enough space on your system partition. This article shows how it is possible to change the partitions with the Parted Magic Linux Live CD.

= Things to know =

Recommendations
I recommend to disconnect all hdds from your computer and only connect the hdd you want to repartition. Then nothing can harm your normal Windows/Linux/MacOS installations on your normal HDDs. The advantage of doing this + being a LS Live/LS Pro user is that you can directly follow my article without rethinking as i had only the LS-HDD connected as well....the devicename /dev/sda will be the same on your system. In case you have other hdds connected make sure you are messing with the right one.

PPC/MIPSel based boxes
The system partition /dev/sda1 cannot be mounted easily because of the ext2_magic_superblock-issue.....you need to correct this first by downloading fix_ext2_magic and make the partition mountable. Read here how to do this: Fix_ext2_magic.

After fixing the ext2_magic superblock on the system partition it should be possible to repartition your box. In contrast to the arm9-boxes it should even be possible to repartition the hdd without loosing the data on the data-partition (/dev/hda3) as ext2/ext3 is directly resizable via GParted.

As this article was written for repartitioning of the arm9-hdds notice that you want to apply this steps instead: If you use ext3 then it should be possible to decrease /dev/hda3 in size...and you do not even need to delete /dev/hda3...which means all your data should be there afterwards. Backups are still recommended to have.
 * Decrease /dev/hda3 in size at the beginning
 * Move /dev/hda2 (swap) to the right
 * Increase /dev/hda1 in size

The concept is the same as outlined here.

flavoie notes on ext3 resizing: You will need to delete partition3 for this to work. ext3 resizing in parted requires the start of a partition to be unmoved. So that means that you could not move the start of partition3, which then restricts the size available to the 1st and 2nd partitions, which are usually the ones you'd like to increase. http://www.gnu.org/software/parted/features.shtml look at *1 - The start of the partition must stay fixed.

Realistically... keep partition1 and delete p2 and p3 and p4. Then increase p1 to the size you want, and recreate p2 and mkswap. Then create p3 to use the rest.

All data on the data partition(s) will be lost
As it is not possible to shrink XFS partitions the only way to make them smaller is to delete and recreate them. So make sure you have a backup of the data and don`t blame me because you did not read this carefully.

Terastation Pro v2, Terastation Live
I haven`t tested this, but i think you can repartition in the same way. you will have to do exactly the same partition layout on all hdds.

= General Procedure = I have done this with a Linkstation Live (arm9) with an 500 GB HDD. I wanted to resize the system partition from ~ 480 MB to 3072 MB ~ 3 GB. This is what i did....

The first thing anyone should do is to look into the manual. We need to open a shell (there is a button at the bottom right) and load the XFS kernel module. Done. now we start the Partition Manager GParted. It is the first Icon on the bottom right.

There we see the current partition layout. The first thing to do is to delete the big XFS data partition /dev/sda6 so we have space for making the other things bigger. Now we need to move the Swap partition a little to the right so we can make the logical partition /dev/sda4 smaller. I moved it 2585 MBs to the right because 2585 + 485 are aproximately 3 GB. Now we resize /dev/sda4 which is the container for the logical partitions for swap and the data. We cut off 2585 at the beginning of /dev/sda4 Now there is a gap bewteen /dev/sda2 and /dev/sda4...we can make /dev/sda2 bigger now. I dragged the right arrow to the complete right...this is how it looked before... and thats how afterwards. Last thing to do is to recreate the data partition. Use the FS of your choice. Note that you need to change /etc/fstab on the system partition later to automount the new FS if you changed it to something else. Apply everything. Swap gets moved... The system partition gets resized.... I was too slow to create a screenshot for the /dev/sda6 recreation step. A report is presented to you. Do not wonder about the 4 warnings...they are related to XFS. Parted_Magic does not have the utils for checking the Filesystem inside. On some systems the growing of the xfs-partition fails. In this case, you need to select the xfs-partition in gparted and Use Partition -> Check. After this, the growing should work. Thats how the LS Live`s partition table looked in the end. FreeLink was installed before. I just put the hdd inside the LS Live again, powered it up..and it booted directly. Here is the proof that everything worked. Good Luck!