View previous topic :: View next topic |
Author |
Message |
andytheg n00b
Joined: 23 Nov 2011 Posts: 71 Location: BASEL
|
Posted: Tue May 08, 2012 12:43 pm Post subject: resize partition in gentoo |
|
|
Hi all,
I would like to resize my partition under /
and add more space.
Code: | Filesystem Size Used Avail Use% Mounted on
rootfs 16G 15G 598M 97% /
/dev/sda5 16G 15G 598M 97% /
rc-svcdir 1.1M 91k 959k 9% /lib/rc/init.d
udev 11M 185k 11M 2% /dev
none 1.6G 0 1.6G 0% /dev/shm
/dev/sda1 132M 44M 89M 33% /boot
|
finally it should be this:
Code: | Filesystem Size Used Avail Use% Mounted on
rootfs 30G 15G 15G 97% /
/dev/sda5 30G 15G 15G 97% /
rc-svcdir 1.1M 91k 959k 9% /lib/rc/init.d
udev 11M 185k 11M 2% /dev
none 1.6G 0 1.6G 0% /dev/shm
/dev/sda1 132M 44M 89M 33% /boot |
Thanks.. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8710 Location: ~Brussels - Belgique
|
Posted: Tue May 08, 2012 12:44 pm Post subject: |
|
|
which filesystem? _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
andytheg n00b
Joined: 23 Nov 2011 Posts: 71 Location: BASEL
|
Posted: Tue May 08, 2012 12:55 pm Post subject: |
|
|
/dev/sda5
I was trying to unmount it, but got:
Code: |
umount2: Device or resource busy
umount: /: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
umount2: Device or resource busy |
|
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8710 Location: ~Brussels - Belgique
|
Posted: Tue May 08, 2012 1:01 pm Post subject: |
|
|
No, my question is not "which partition", but "which filesystem" : ext, btrfs, xfs, reiser... ?
Some filesystems accept to be resized, some other not.
The best way is to boot a live CD (e.g. SystemRescueCD) and resize the partitions (e.g. with gparted). _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
andytheg n00b
Joined: 23 Nov 2011 Posts: 71 Location: BASEL
|
Posted: Tue May 08, 2012 1:08 pm Post subject: |
|
|
ext3 |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8710 Location: ~Brussels - Belgique
|
Posted: Tue May 08, 2012 1:10 pm Post subject: |
|
|
ext3 can be resized, you are happy
IMHO I prefer the solution of "backup/restore", which is sometimes much faster than move a partition. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
andytheg n00b
Joined: 23 Nov 2011 Posts: 71 Location: BASEL
|
Posted: Tue May 08, 2012 1:16 pm Post subject: |
|
|
uffff
my system runs on a virtual disk i could resize, but my home directory still has 16 gb left.
I was reading about resize the partition but i dont know the steps i have to do exactly... |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8710 Location: ~Brussels - Belgique
|
Posted: Tue May 08, 2012 1:21 pm Post subject: |
|
|
boot a linux LiveCD, for example SystemRescueCD and resize the partition to adjust to the disk. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
andytheg n00b
Joined: 23 Nov 2011 Posts: 71 Location: BASEL
|
Posted: Tue May 08, 2012 2:36 pm Post subject: |
|
|
well I can't use a cd rom the gentoo is running on a xen server (virtual system) Is there a tool out I can use for change the partition?
emerge?
Thanks... |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8710 Location: ~Brussels - Belgique
|
Posted: Tue May 08, 2012 5:52 pm Post subject: |
|
|
Hello,
It is really not recommended to resize the root partition when it runs. You need to start an other system to resize it.
Use the ISO image of the CD-ROM _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54300 Location: 56N 3W
|
Posted: Tue May 08, 2012 6:06 pm Post subject: |
|
|
andytheg,
Resizing a filesystem is a two step process, maybe three step process.
First, you need some free space physically located at the end of the partition to be grown
Now you can resize the partition to include that free space. You cannot do this while the filesystem is mouted and you may need a reboot to get the kernel to see the new size anyway.
Once the additional space is in the partition, the filesystem can be grown into it. Ths step can be done on the live in use filesystem
If you want to make a habit of this sort of thing, you should use Logical Volume Manager, which is designed to expand and shrink logical volumes while they are in use - provided always the filesystems support grow/shrink. You cannot add LVM now - its an install time oprion.
To create space on root, you could move /usr/portage to /home/portage. Thats simpler and less risky than a partition resize. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
djdunn l33t
Joined: 26 Dec 2004 Posts: 810
|
Posted: Thu May 10, 2012 2:21 am Post subject: |
|
|
you can always add LVM or luks or whatever, you just need an intermediary device to store your hard drive information on while you reset it up _________________ “Music is a moral law. It gives a soul to the Universe, wings to the mind, flight to the imagination, a charm to sadness, gaiety and life to everything. It is the essence of order, and leads to all that is good and just and beautiful.”
― Plato |
|
Back to top |
|
|
|