Finally i managed it myself.
I did the following to move the root partition to a btrfs subvolume.
I booted from a live usb-stick.
Mounted the btrfs disk and subvolume
Code:
mkdir -p /mnt/btrfs-disk /mnt/btrfs-root
mount /dev/sda5 /mnt/btrfs-disk
mount -o subvol=@ /dev/sda5 /mnt/btrfs-root (my actual root subvolume)
Copied the root partition to the '@' subvolume (/mnt/btrfs-root)
Code:
rsync -raHAX --exclude '@,home, @home and so on' /mnt/btrfs-disk /mnt/btrfs-root
Edited grub.conf to boot from subvolume '@' instead of /dev/sda5
Code:
linux /@/boot/vmlinuz-3.2.0-25-generic root=UUID=0899f4b5-a8d5-4499-95b8-4f075f9cf543 ro rootflags=subvol=@ quiet splash $vt_handoff
Chrooted into the '@' subvolume
Code:
mount -o bind /dev /mnt/btrfs-root/dev
mount -o bind /sys /mnt/btrfs-root/sys
mount -t proc /proc /mnt/btrfs-root/proc
cp /proc/mount /mnt/btrfs-root/etc/mtab
chroot /mnt/btrfs-root /bin/bash
Then installed and updated Grub
Code:
grub-install /dev/sda
update-grub
Then i moved all directories except '@' and '@home' (subvolumes) to /oldRoot (can be deleted)
reboot and now its working!!
Bookmarks