Skip to content

Instantly share code, notes, and snippets.

@skarllot
Created July 20, 2015 18:28
Show Gist options
  • Save skarllot/1f4e16f171b8a8a35ecf to your computer and use it in GitHub Desktop.
Save skarllot/1f4e16f171b8a8a35ecf to your computer and use it in GitHub Desktop.
Move data around
kernel /vmlinuz root=/dev/sdX ro rootfsflags=subvol=<subvolume name>
pvcreate /dev/new
vgextend vgX /dev/new
pvmove /dev/old
vgreduce vgX /dev/old
# Local copy
cd /origin
find ./ -xdev -print0 | cpio -pa0V /mnt/dest
# Remote copy
cd /origin
find ./ -xdev -print0 | cpio -oa0V | ssh user@host 'cpio -imVd'
# Update GRUB
chroot /mnt/dest /usr/sbin/grub-install --recheck /dev/new
# or
/usr/sbin/grub-install --recheck --root-directory /mnt/dest /dev/new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment