meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:fs:btrfs_as_root [2016/04/21 08:18] – niziak | 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 ===== | ||
| - | <code bash> | ||
| - | fsck -f /dev/sda1 | ||
| - | fsck -f /dev/sda6 | ||
| - | |||
| - | btrfs-convert /dev/sda1 | ||
| - | </ | ||
| - | |||
| - | Disk usage before conversion: used 1.56GB, free 2.53GB | ||
| - | after conversion: used 1.65GB, free 2.43GB | ||
| - | |||
| - | <code bash> | ||
| - | |||
| - | ===== 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 | ||
| - | </ | ||
| - | |||
| - | get new UUID of /dev/sda1 using " | ||
| - | mount /dev/sda1 somewhere, go to etc/fstab and update to new UUID: | ||
| - | |||
| - | UUID=a74f5787-aee1-4981-b7e6-fbd3cb6ac919 / | ||
| - | |||
| - | <code bash> | ||
| - | update-grub | ||
| - | grub-install /dev/sda | ||
| - | |||
| - | exit | ||
| - | |||
| - | reboot | ||
| - | </ | ||
| - | |||
| - | and remove Live CD with Gparted | ||
| - | |||
| - | ===== rollback to ext FS ===== | ||
| - | Rollback to ext2 is possible. There is subvolume ext2_saved on filesystem. | ||
| - | <code bash> | ||
| - | To delete backup | ||
| - | <code bash> | ||
| ===== Update to kernel 4 ===== | ===== Update to kernel 4 ===== | ||
| Line 87: | Line 43: | ||
| * /@home | * /@home | ||
| * /@var | * /@var | ||
| + | |||
| + | Mount BTRFS filesystem (BTRFS root) to /mnt/btrfs. | ||
| ==== root ==== | ==== root ==== | ||
| - | * take a snapshot of root volume | + | * take a snapshot of root volume. Name of snapshot is ' |
| - | * '' | + | * '' |
| - | * delete files on BTRFS root | + | * delete files on BTRFS root (/ |
| - | * make @root subvolume a default root | + | * make @ subvolume a default root |
| - | * update fstab:< | + | * update fstab:< |
| - | * OR set | + | * OR |
| + | * get @ subvolume | ||
| + | * set default | ||
| Line 106: | Line 66: | ||
| * '' | * '' | ||
| * update /etc/fstab to mount @home as /home | * update /etc/fstab to mount @home as /home | ||
| + | |||
| + | ===== fstab ==== | ||
| + | Do not use '' | ||
| + | Example working fstab file: | ||
| + | <file | / | ||
| + | UUID=ed730508-753e-4a7f-ac1e-bf8646f7bd63 / | ||
| + | UUID=ed730508-753e-4a7f-ac1e-bf8646f7bd63 / | ||
| + | UUID=ed730508-753e-4a7f-ac1e-bf8646f7bd63 / | ||
| + | UUID=ed730508-753e-4a7f-ac1e-bf8646f7bd63 / | ||
| + | UUID=ed730508-753e-4a7f-ac1e-bf8646f7bd63 / | ||
| + | </ | ||
| + | |||
| + | To prevent systemd to halt system during startup if device is not found (nofail and x-systemd.device-timeout): | ||
| + | <file | / | ||
| + | UUID=< | ||
| + | </ | ||
| + | NOTE: do not use autodefrag - it consumes lots of cpu | ||