

rick
-
Posts
18 -
Joined
-
Last visited
Reputation Activity
-
rick got a reaction from XTL in Btrfs as root filesystem?
It worked. It took some trial and error because I was missing something btrfs related, but here is a cleaned up version of my steps:
# If the kernel has btrfs as external module (turns out I did not need this step):
#Insert a line to /etc/initramfs-tools/modules containing: "btrfs"
#make new uInitrd with btrfs module:
mkinitramfs -c gzip -o ./initrd `uname -r`
mkimage -C none -A arm -O linux -T ramdisk -a 0 -e 0 -n initramfs -d ./initrd uInitrd
rm -f ./initrd
# now insert SD into another device like a PC
# create a new btrfs partition for root
#create subvolume for root
btrfs sub create @
#move everything in "/" to @ except for /boot which remains ext4
# mkdir /boot on the NEW btrfs root filesystem
# move everything from originalext4fs/boot on the OLD ext4 filesystem up one level to originalext4fs/
# from the root of the OLD ext4 ( originalext4fs/ )
ln -s . boot
# use "btrfs filesystem show" or whatever to find the new uuid
# edit/update /boot/boot.cmd
#change root=??? to root=UUID=YourNewBtrfsUUID
#change to rootfstype=btrfs
#add rootflags=subvol=@
# generate new boot.scr:
apt-get install u-boot-tools # if not installed already
mkimage -C none -A arm -T script -d ./boot.cmd ./boot.scr
# edit fstab to look something like this:
#old ext4 now /boot:
/dev/mmcblk0p1 /boot ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
#new btrfs root :
UUID=newuuid-for-btrfs / btrfs subvol=@,defaults,noatime,nodiratime 0 1
# no change:
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0
#reboot and see if you can do the happy dance like me!
-
rick got a reaction from tkaiser in Btrfs as root filesystem?
It worked. It took some trial and error because I was missing something btrfs related, but here is a cleaned up version of my steps:
# If the kernel has btrfs as external module (turns out I did not need this step):
#Insert a line to /etc/initramfs-tools/modules containing: "btrfs"
#make new uInitrd with btrfs module:
mkinitramfs -c gzip -o ./initrd `uname -r`
mkimage -C none -A arm -O linux -T ramdisk -a 0 -e 0 -n initramfs -d ./initrd uInitrd
rm -f ./initrd
# now insert SD into another device like a PC
# create a new btrfs partition for root
#create subvolume for root
btrfs sub create @
#move everything in "/" to @ except for /boot which remains ext4
# mkdir /boot on the NEW btrfs root filesystem
# move everything from originalext4fs/boot on the OLD ext4 filesystem up one level to originalext4fs/
# from the root of the OLD ext4 ( originalext4fs/ )
ln -s . boot
# use "btrfs filesystem show" or whatever to find the new uuid
# edit/update /boot/boot.cmd
#change root=??? to root=UUID=YourNewBtrfsUUID
#change to rootfstype=btrfs
#add rootflags=subvol=@
# generate new boot.scr:
apt-get install u-boot-tools # if not installed already
mkimage -C none -A arm -T script -d ./boot.cmd ./boot.scr
# edit fstab to look something like this:
#old ext4 now /boot:
/dev/mmcblk0p1 /boot ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
#new btrfs root :
UUID=newuuid-for-btrfs / btrfs subvol=@,defaults,noatime,nodiratime 0 1
# no change:
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0
#reboot and see if you can do the happy dance like me!