[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Using parted to resize partitions in a Woody HPPA system

Hi everybody,

My system has one 4GB HD (/dev/sda). At the moment, /dev/sda7 (/var) partition has almost 2GB, while /dev/sda6 (/usr) partition is just 0.9GB wide - ok, its weird, don't ask... I intend to use parted to fix it. So I got some hints from parted manual and imagined the following procedure:

1.  List current partition table: parted>p
minor        start        end           type        filesystems    flags
1            0.030        96.632        primary                    boot
2 ...
5 ...
6            1100         2000          logical     ext2
7            2000         4000          logical     ext2

Shrink the /var partition (it's the last one) by 1.5GB : parted>resize 7 2000 2300

2. Make a new partition at the end of the disk, big enough for the new /var: parted>mkpartfs logical ext2 3700 4000

3. Copy the old (shrinked) /var (/dev/sda7) to the new one: parted>cp 7 8

4. Remove the old one: parted>rm 7

5. Grow /usr to occupy new open space: parted>resize 6 1100 3700

6. Exit: parted>quit

No changes will be needed in fstab, because the partition numbers didn't changed.Also, root and boot partitions weren't touched, so I think that I won't have any problems with the bootloader. So, proceedand reboot system, and that's it.

At this time I have no media do make backup disk images, and I want avoid reinstalling all stuff again (data is already safe), so this must work in the first try. Any comments? Anyone?

Thanks a lot,
Joao Roscoe

Reply to: