Web lists-archives.com

Re: making more room in root partition for distribution upgrade




Hi,

On Thu, May 17, 2018 at 06:06:46PM -0500, Mark Copper wrote:

[sda1 root partition got too small; extended partition on sda2 fills
remainder of disk]

> This must be a FAQ. But there appear to be two ways forward.
> 
> 1. Back-up /home, enlarge / partition, copy back-up back to new, smaller
> /home partition (because /home will then start on a different cylinder so
> data will be lost).
> 
> or
> 
> 2. Carve out a new partition for /usr at end of disk which will free up
> over 6 gb.
> 
> What have other people done?

If using multiple partitions per disk, consider using LVM in future
as otherwise this sort of thing nearly always becomes a chore.

Personally in your situation I'd probably back up /home and then
turn /home's device (/dev/sda6) into an LVM PV, then create LVs for
/home, /var and whatever else takes up significant space before
copying the /home data back in.

My reasoning for this is that as you do all of this work as root,
everything in /home is basically just data that is not required for
managing the system. Therefore the procedure is simpler and less
error-prone, in my opinion. It avoids messing about with the root
filesystem, and any kind of partition resizing.

When using LVM I don't tend to split up / and /usr. It is perfectly
possible to have / in LVM; modern grub will cope. But I tend to find
that after one has put all of the larger subdirectories into their
own LV, the combined space usage of /-and-/usr is fairly small and
mostly static. So for simplicity's sake I just rather pick a
reasonable size for / and keep it as a real partition with /usr
inside it.

I don't generally see the point of putting swap into LVM either,
again because the size of it rarely changes. Should you find you do
require more swap it can always be added later as devices or
swapfile.

As you can see I greatly value simplicity, which for me is a
hard-won lesson in the sysadmin trenches. Other people like a more
exciting life, so each to their own. :)

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting