Re: Moving LVM volume?
On Thursday 01 January 2015 10:21:12 Joe wrote:
> On Thu, 1 Jan 2015 01:54:39 +0000 (UTC)
>
> Frank Miles <fpm@u.washington.edu> wrote:
> > I recently added a new hard drive to my home system. I decided to
> > use it to create an all-new bootable 'jessie' system. I created a
> >
> > partition table that I thought would be flexible:
> > /dev/sdb1 / (root) {7G}
> > /dev/sdb2 /swap {4GB}
> > /dev/sdb3 /oldjunk {1G}
> > /dev/sdb4 extended {remainder}
> > /dev/sdb5 LVM {one large volume}
> >
> > Most of the partitions- /usr, /home, /var, ... were in LVM2.
> >
> > What I've learned since then is that /usr seems to have special
> > status, and probably shouldn't be part of LVM as certain tasks
> > early in the boot process can't seem to access the interior of
> > LVM.
> >
> > I've moved 'oldjunk' into the LVM, and want to expand this
> > partition to become the new /usr. I've shrunk the LVM, but
> > the freed space is all at the far end of the LVM. I have
> > been unable to move it towards the end of the disk space,
> > so I can expand /dev/sdb3. gparted, resize2fs, pvmove,...
> > (running from a CDROM-based rescue disk) have all failed.
> >
> > Is there some method that I've overlooked?
>
> Is the system installed and running yet? If so, check the space used by
> the main mountpoints. Almost certainly, /usr is the largest of the
> system partitions. My workstation /usr is about 8GB, and I don't have
> any modern games. Excluding /home, the total is just over 10GB.
>
> Next, there's no problem having the entire system on LVM, including
> /boot. I still have a /boot partition, for legacy reasons, but the rest
> is in one LVM volume, indeed in a single partition apart from /home. On
> a workstation, there's no great advantage to using separate partitions
> for anything else.
>
> Next, unless you want to mess with the building of the boot ramdisk,
> the issue with /usr is that it must be mounted at the same time as the
> root partition gets mounted during boot, so it needs to be physically
> stored under /, and any separate /usr partition will still potentially
> have problems. At the moment, I'm not aware of any show-stoppers caused
> by having a separate /usr, but I've no doubt it will happen in time.
I had no problems with dedicated servers(*) with a separate /usr partition (up
to Jessie) but on a desktop machine with KDE I observed weird and
unpredictable problems which completely disappeared as soon as I put /usr into
the same partition as / .
(*) one server for one task
One thing I would take into account when deciding whether to set up a system
with /usr not being mounted early or making /usr part of / :
It might work all right in the beginning but with every update the chances are
that you run into problems which seem to be weird and are difficult to nail
down.
>
> To be honest, unless you already have a significant investment in the
> new system, I'd suggest starting again.
--
Eike Lantzsch ZP6CGE
Reply to: