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

Re: Using parted to resize partitions in a Woody HPPA system



Joao Carlos de Lima Roscoe wrote:

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:

hmm I have no experience with parted but don't you have to umount /var and /usr fs before all? It is not clear in 'man parted' but it shouldn't be a pb as parted stand in /sbin (and more safe? ) May be should you operate in single user mode to be able to umount /usr (iirc add option -s after the name of your kernel into interactive palo
before:
0: 3/vmlinux
1: root=/dev/sda5
[...]

when:
3/vmlinux -s

after:
0: 3/vmlinux
1: -s
2: root=/dev/sda5)


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

That is the most dangerous without backup !!!
My /var is about 40Mb and and backup like 'tar cjspf /SomeOtherFS/Var.tar.bz2 /var' could be reduced to 10Mb. So you could certainly find a place for such backup (not /var and not /usr :) )? (important because /var contains the dpkg db !!)
Or don't you have a remote system to make such backup?



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.

yes

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

Good luck,
   Joel

PS: For my own I have enough with /var of about 250mb



Reply to: