Difference between revisions of "Resizing the system partition with parted magic live cd"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(Resizing_the_system_partition_with_parted_magic_live_cd)
 
(General Procedure)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Articles|LSLive|LSPro|Terastation|LS1|HG|HS|LS2}}
 +
 
= About =
 
= About =
 
If you installed any [[Custom_firmwares|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 [http://partedmagic.com/ Parted Magic Linux Live CD].
 
If you installed any [[Custom_firmwares|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 [http://partedmagic.com/ Parted Magic Linux Live CD].
Line 5: Line 7:
 
== Recommendations ==
 
== 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. <br>
 
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. <br>
The advantage of doing so 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.
+
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 ==
 
== 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.<br>
 
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.<br>
 
Read here how to do this: [[Fix_ext2_magic]].
 
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:<br>
+
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. <br>
 +
 
 +
As this article was written for repartitioning of the arm9-hdds notice that you want to apply this steps instead:<br>
 
* Decrease /dev/hda3 in size at the beginning
 
* Decrease /dev/hda3 in size at the beginning
 
* Move /dev/hda2 (swap) to the right
 
* Move /dev/hda2 (swap) to the right
 
* Increase /dev/hda1 in size
 
* Increase /dev/hda1 in size
 +
<br>
 +
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.<br>
  
 
The concept is the same as outlined here.
 
The concept is the same as outlined here.
 +
 +
flavoie notes on ext3 resizing:<br>
 +
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.
 +
 
== ARM9 based boxes ==
 
== ARM9 based boxes ==
 
=== All data on the data partition(s) will be lost ===
 
=== All data on the data partition(s) will be lost ===
Line 59: Line 77:
 
[[Image:growing_system_partition_with_parted_magic_19.jpeg]]<br><br>
 
[[Image:growing_system_partition_with_parted_magic_19.jpeg]]<br><br>
 
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.<br>
 
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.<br>
 +
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.<br>
 
[[Image:growing_system_partition_with_parted_magic_20.jpeg]]<br><br>
 
[[Image:growing_system_partition_with_parted_magic_20.jpeg]]<br><br>
 
Thats how the LS Live`s partition table looked in the end.<br>
 
Thats how the LS Live`s partition table looked in the end.<br>

Latest revision as of 19:00, 3 November 2007


Contents

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:

  • Decrease /dev/hda3 in size at the beginning
  • Move /dev/hda2 (swap) to the right
  • Increase /dev/hda1 in size


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.

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.

ARM9 based boxes

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. Growing system partition with parted magic 1.jpeg

We need to open a shell (there is a button at the bottom right) and load the XFS kernel module.
Growing system partition with parted magic 2.jpeg

Done. now we start the Partition Manager GParted. It is the first Icon on the bottom right.
Growing system partition with parted magic 3.jpeg

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.
Growing system partition with parted magic 4.jpeg

Now we need to move the Swap partition a little to the right so we can make the logical partition /dev/sda4 smaller. Growing system partition with parted magic 7.jpeg

I moved it 2585 MBs to the right because 2585 + 485 are aproximately 3 GB.
Growing system partition with parted magic 9.jpeg

Now we resize /dev/sda4 which is the container for the logical partitions for swap and the data.
Growing system partition with parted magic 10.jpeg

We cut off 2585 at the beginning of /dev/sda4
Growing system partition with parted magic 11.jpeg

Now there is a gap bewteen /dev/sda2 and /dev/sda4...we can make /dev/sda2 bigger now.
Growing system partition with parted magic 12.jpeg

I dragged the right arrow to the complete right...this is how it looked before...
Growing system partition with parted magic 13.jpeg

and thats how afterwards.
Growing system partition with parted magic 14.jpeg

Last thing to do is to recreate the data partition.
Growing system partition with parted magic 15.jpeg

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.
Growing system partition with parted magic 16.jpeg

Apply everything.
Growing system partition with parted magic 17.jpeg

Swap gets moved...
Growing system partition with parted magic 18.jpeg

The system partition gets resized....
Growing system partition with parted magic 19.jpeg

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.
Growing system partition with parted magic 20.jpeg

Thats how the LS Live`s partition table looked in the end.
Growing system partition with parted magic 21.jpeg

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.
Growing system partition with parted magic 22.jpeg


Good Luck!