[SOLVED] Resize home and root partitions

You have a problem with Salix? Post here and we'll do what we can to help.
bobferrell
Posts: 17
Joined: 11. Feb 2012, 20:04

[SOLVED] Resize home and root partitions

Post by bobferrell »

Hello,

I installed Salix using the autoformat option, which created a 6 GB root volume and a 900+ GB /home partition. Now I can't install any more applications. Is it possible to resize the root partition to give myself more space without losing my data?
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Resize home and root partitions

Post by mimosa »

It's always a good idea to back up your data when making changes to partitions.

However, it should be straightforward to do what you want using Gparted: shrink /home and expand /. Note that you cannot do so from within the installation - use a live cd (or USB). Make sure the partitions aren't mounted - this can be done inside gparted or just umount -a from console. You may also need to turn off swap (again, either in gparted or swapoff -a in console). Afterwards, from a terminal, run (as root):

Code: Select all

lilo -v
Any trouble booting, run lilosetup from the live cd (or liloconfig).
bobferrell
Posts: 17
Joined: 11. Feb 2012, 20:04

Re: Resize home and root partitions

Post by bobferrell »

I tried gparted, using the Salix live CD and I only see one partition.
/dev/sda1, flagged as bios_grub which is 1 MB
/dev/sda2, a linux swap which is 500 MB
/dev/sda3, flagged as lvm which is 931 GB

It doesn't appear to me that sda1 is the root partition.

When I log in, root is listed as 5.9 GB and home is 925 GB
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Resize home and root partitions

Post by mimosa »

I'm puzzled. Could it be that sda3 is an *extended* partition, containing your / and /home?

When I opened gparted just now, that's pretty much how my own system is set up, but the extended partition appears with a little triangle to its left, pointing down, and below are the logical partitions it contains. Clicking on this triangle hides them or makes them reappear; and the triangle rotates left ninety degrees.

But it sounds as though you are seeing something different.

It may help if you post the output of (as root, in a terminal)

Code: Select all

parted -l
bobferrell
Posts: 17
Joined: 11. Feb 2012, 20:04

Re: Resize home and root partitions

Post by bobferrell »

Wow... This is concerning...
This is the output:

# parted -l
Warning: /dev/sda contains GPT signatures, indicating that it has a GPT table.
However, it does not have a valid fake msdos partition table, as it should.
Perhaps it was corrupted -- possibly by a program that doesn't understand GPT
partition tables. Or perhaps you deleted the GPT table, and are now using an
msdos partition table. Is this a GPT partition table?
Yes/No?

Not sure how to answer this.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Resize home and root partitions

Post by mimosa »

Neither am I. Do you have some ultra-high-tech state-of-the-art machine? :)

Wiser heads may shed some light on this. But if you haven't got too much data on the machine yet (and I take it you're not dual-booting), it may be worth simply reinstalling, making sure you say "yes" if you're asked whether to format, and preferring the more thorough option. I don't know whether you installed from the Live CD, but it's quite a nice installer too.

Should you choose to go down this path, I'd suggest wiping everything first using gparted from Live, as thoroughly as possible. You're obviously not dual-booting ......

EDIT

In particular, go to the "Device" menu in Gparted and create a new partition table. Everything needs to be unmounted. Everything will be wiped.
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Resize home and root partitions

Post by mimosa »

A quick internet search indeed suggests that you have a cutting-edge booting arrangement and I'd suggest waiting for further input from people who know about this "GPT" before taking any radical steps. It'd be a shame to break it. ;)

EDIT

However, as far as parted is concerned: try saying "No" and see what output you get then. parted won't actually do anything with the -l switch; it just means "tell me what are the partitions".
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: Resize home and root partitions

Post by Shador »

Let's shed some light on this. :D
GPT and MBR are partition tables. While the latter is fairly old and has some restrictions, it still works sufficiently for most desktop machines. GPT is a comparably new development closely tied to EFI the successor of BIOS. Both are not that new actually. Apple machines are using EFI + GPT for years, if not since the beginning. That combination is also starting to slowly push into the general pc market.

Anyway so much for the background. Now regarding your problem. You can look upon your disk as a book. The partition table is the index of your disk which remembers how the space is partitioned. MBR and GPT are both partition tables look upon them as different kinds of indexes. MBR is usually stored on the first page of the book. For compatibility reasons gpt is stored a bit behind it let's say the 2nd page. I'm not completely sure of the very exact location atm.
Maybe you can already imagine what happened. Before you installed Salix your disk was managed by GPT, which puts a so called protective MBR into place that marks the whole disk as used by GPT.
Now by installing Salix that MBR and the old filesystems (at least so much of the fs to make it work) were overwritten and everything got setup correctly. Exactly what you'd want. Just that the old now probably unneeded and invalid GPT index is still there as it's stored on another page of the book that wasn't overwritten. (On a sidenote such problems can also occur with filesystems. They store a signature somewhere inside the partition but not always in the same place. So it can sometimes happen that the area containing the old signature is not overwritten on a format. Overwriting the whole space would be just extremely inefficient. When that happens partitions can show up as the old fs. But for common fs that's very uncommon.)

So the best idea is to overwrite that part of the disk now to make clear that you're using MBR now.
Can you post the output of fdisk -l so I can make sure nothing else is accidentally overwitten?
Your current setup does NOT endanger any data of yours and once we clean the old traces it shouldn't bother anymore.

BTW just noticed: What I'm reffering to as MBR is also referred to as msdos partiton table. And partition table is also sometimes referred to as partmap e.g. by grub. So don't be confused.
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Resize home and root partitions

Post by mimosa »

See also:

http://www.rodsbooks.com/missing-parts/

which is in accord with what Shador says. However I'd follow Shador's instructions :)
bobferrell
Posts: 17
Joined: 11. Feb 2012, 20:04

Re: Resize home and root partitions

Post by bobferrell »

Thank you so much. That does make sense...

Here is the output to fdisk.

# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util
fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4588832f

Device Boot Start End Blocks Id System
/dev/sda1 * 63 12289724 6144831 83 Linux
/dev/sda2 12289725 14346044 1028160 82 Linux swap
/dev/sda3 14346045 1953520064 969587010 83 Linux
Post Reply