Resizing root partition by taking space from /home

init 1

umount /dev/mapper/debian-home
e2fsck -f /dev/mapper/debian-home
resize2fs /dev/mapper/debian-home 100G
lvreduce -L 50G /dev/debian/home
lvextend -L 10G /dev/debian/root
resize2fs /dev/mapper/debian-root
mount /dev/mapper/debian-home

lvmcache

By using these steps you can use a SSD drive to cache a regular hard drive. The cache can be dynamically added and removed with no loss of data or interruption of a mounted filesystem. See also man lvmcache.

sudo lvcreate -n home2_cache -l 100%free ramanujan /dev/mapper/r2fluorine_decrypt
sudo lvconvert --type cache --cachepool ramanujan/home2_cache ramanujan/home2

sudo lvs -o+cache_mode,chunksize
sudo lvs -o name,cache_read_hits,cache_read_misses,cache_total_blocks,cache_used_blocks ramanujan/root2 ramanujan/home2

lvconvert --splitcache VG/CacheLV   # split cache
lvconvert --uncache VG/CacheLV      # split cache and delete cache LV.  origin unchanged.

Making it work from initrafms: http://forums.debian.net/viewtopic.php?t=119644, https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1423796. Install thin-provisioning-tools, in /etc/initramfs-tools/hooks/lvmcache:

PREREQ="lvm2"

prereqs()
{
    echo "$PREREQ"
}

case $1 in
prereqs)
    prereqs
    exit 0
    ;;
esac

if [ ! -x /usr/sbin/cache_check ]; then
    exit 0
fi

. /usr/share/initramfs-tools/hook-functions

copy_exec /usr/sbin/cache_check

manual_add_modules dm_cache dm_cache_mq

DebianNotes/LVM (last edited 2017-03-09 20:03:09 by 82-181-83-123)