Josh-Daniel S. Davis (joshdavis) wrote,
Josh-Daniel S. Davis
joshdavis

ubuntu shrink root

/var, /usr, /home, and /tmp were all fairly easy to replace live.

/ is a special case.  I did the following:
grub
e
root=/dev/ram0 rw
^X
Wait for mdadm to finish complaining.
alias ll='ls -laF'
mkdir /mnt
lvm pvscan
lvm vgscan
lvm vgchange -a y
e2fsck -f

/var, /usr, /home, and /tmp were all fairly easy to replace live.

/ is a special case.  I did the following:
grub
e
root=/dev/ram0 rw
^X
Wait for mdadm to finish complaining.
alias ll='ls -laF'
mkdir /mnt
lvm pvscan
lvm vgscan
lvm vgchange -a y
e2fsck -f /dev/ubuntu-vg/root
mount /dev/ubuntu-vg/root /mnt
cd /mnt
cp -a lib lib65 bin sbin /
cd /
umount /mnt
e2fsck -f /dev/ubuntu-vg/root
resize2fs -M /dev/ubuntu-vg/root
lvreduce -L 1120M /dev/ubuntu-vg/root
e2fsck -f /dev/ubuntu-vg/root
resize2fs /dev/ubuntu-vg/root
umount -a


http://omnitech.net/reference/2018/03/08/ubuntu-shrink-root/

This entry was originally posted at https://xaminmo.dreamwidth.org/1504811.html. Please comment there using OpenID.
Tags: lvm, pivot, ramdisk, root, ubuntu, xenial
Subscribe
Comments for this post were disabled by the author