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

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

Fine, lets go the boot way, the safer, the better  :-).
As far as I am not messing with /boot, palo will still work fine, right?

Joao Roscoe

Joel Soete wrote:

Joao Carlos de Lima Roscoe wrote:

Ok, I agree with you, it's better to be in the safe side, so I already have my /var in a .tar.bz2 file in another partition. To go single user I can just do init 1, isn't it?

Theoriticaly yes

Or I must go the boot way?

In practice, some resources are not corectly free (I never understand why but under hpux to resize or simply fsck /usr fs, I always had to reboot in single usermode? That is certainly why I would prefer)

And then, just umount /var, do the schrink / move / remove steps, mount /var again and proceed to /usr steps...

Exactly, I already had to do such resizing on my i386 linux box but whith fdisk and resize2fs (for the extension of /usr) and backup, fdisk, mke2fs, restore for /var). Your method would be so definitely more efficient :)


Joao Roscoe

Joel Soete wrote:

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
0: 3/vmlinux
1: root=/dev/sda5

3/vmlinux -s

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.


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,

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

Reply to: