meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:fs:btrfs_as_root [2016/11/27 13:46] niziak [fstab] |
linux:fs:btrfs_as_root [2017/01/18 21:41] (current) niziak |
||
---|---|---|---|
Line 16: | Line 16: | ||
- btrfs utils version 3.17 | - btrfs utils version 3.17 | ||
- | |||
- | ===== Conversion ===== | ||
- | It not well tested and recommended. Especially for Kernels > 4.0. | ||
- | Personaly it generates errors on BTRFS which will appear after some time. | ||
- | Better way is to use additional temporary disc to move data to newly created BTRFS. | ||
- | <code bash> | ||
- | fsck -f /dev/sda1 | ||
- | fsck -f /dev/sda6 | ||
- | |||
- | btrfs-convert /dev/sda1 | ||
- | </code> | ||
- | |||
- | Disk usage before conversion: used 1.56GB, free 2.53GB | ||
- | after conversion: used 1.65GB, free 2.43GB | ||
- | |||
- | <code bash>btrfs check /dev/sda1</code> | ||
- | |||
- | ===== Update system ===== | ||
- | Mount new root filesystem: | ||
- | |||
- | <code bash> | ||
- | mount /dev/sda1 /mnt | ||
- | for i in dev dev/pts proc sys ; do mount --bind /$i /mnt/$i ; done | ||
- | chroot /mnt | ||
- | </code> | ||
- | |||
- | get new UUID of /dev/sda1 using "blkid" | ||
- | mount /dev/sda1 somewhere, go to etc/fstab and update to new UUID: | ||
- | |||
- | UUID=a74f5787-aee1-4981-b7e6-fbd3cb6ac919 / btrfs defaults 0 1 | ||
- | |||
- | <code bash> | ||
- | mount /boot # if on separate partition | ||
- | update-grub | ||
- | grub-install /dev/sda | ||
- | umount /boot | ||
- | |||
- | exit # from chrooted env | ||
- | |||
- | reboot | ||
- | </code> | ||
- | |||
- | and remove Live CD / USB with Gparted | ||
- | |||
- | ===== rollback to ext FS ===== | ||
- | Rollback to ext2 is possible. There is subvolume ext2_saved on filesystem. | ||
- | <code bash>btrfs subvolume list /</code> | ||
- | To delete backup | ||
- | <code bash>btrfs subvolume delete /ext2_saved</code> | ||
===== Update to kernel 4 ===== | ===== Update to kernel 4 ===== | ||
Line 127: | Line 78: | ||
</file> | </file> | ||
- | To prevent systemd to halt system during startup if device is not found: | + | To prevent systemd to halt system during startup if device is not found (nofail and x-systemd.device-timeout): |
<file | /etc/fstab> | <file | /etc/fstab> | ||
- | UUID=<the_device_uuid> /mount/point btrfs x-systemd.device-timeout=10,noatime,compress=lzo,autodefrag 0 0 | + | UUID=<the_device_uuid> /mount/point btrfs nofail,x-systemd.device-timeout=10,noatime,compress=lzo,autodefrag 0 0 |
</file> | </file> | ||
+ | NOTE: do not use autodefrag - it consumes lots of cpu |