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_root2 [2017/01/20 13:21] – niziak | linux:fs:btrfs_as_root2 [2025/03/24 08:32] (current) – ↷ Links adapted because of a move operation niziak | ||
|---|---|---|---|
| Line 52: | Line 52: | ||
| **NOTE:** Create subvolumes for things which shouldn' | **NOTE:** Create subvolumes for things which shouldn' | ||
| + | |||
| + | [[https:// | ||
| <code bash> | <code bash> | ||
| Line 119: | Line 121: | ||
| Create subvolumes: | Create subvolumes: | ||
| - | < | + | < |
| cd /mnt | cd /mnt | ||
| btrfs subvolume create @pool | btrfs subvolume create @pool | ||
| Line 130: | Line 132: | ||
| </ | </ | ||
| + | [[https:// | ||
| ===== Add 2nd disc ===== | ===== Add 2nd disc ===== | ||
| - | Copy partition layouts from sdb to sda drive: | + | See [[.btrfs:multidisk]] |
| - | <code bash> | + | |
| - | sudo sfdisk -d /dev/sdb > parts | + | |
| - | sudo sfdisk | + | |
| - | </ | + | |
| - | + | ||
| - | Recreate LVM layout. | + | |
| - | + | ||
| - | Add 2nd disc to btrfs: | + | |
| - | <code bash> | + | |
| - | btrfs device add / | + | |
| - | btrfs device usage / | + | |
| - | btrfs balance start -v -dconvert=raid1 -mconvert=raid1 / | + | |
| - | btrfs device usage / | + | |
| - | </ | + | |
| - | + | ||
| - | Let system boot without one disc: | + | |
| - | <file | / | + | |
| - | GRUB_CMDLINE_LINUX_DEFAULT=" | + | |
| - | </ | + | |
| - | <code bash> | + | |
| - | + | ||
| - | Install grub | + | |
| - | <code bash> | + | |
| - | sudo grub-install /dev/sdb | + | |
| - | sudo grub-install /dev/sdc | + | |
| - | reboot | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Issues ==== | + | |
| - | + | ||
| - | === Grub === | + | |
| - | **PROBLEM** | + | |
| - | **'' | + | |
| - | < | + | |
| - | | + | |
| - | / | + | |
| - | </ | + | |
| - | More here: [[https:// | + | |
| - | **SOLUTION** | + | |
| - | Fixed in Debian Stretch (testing) version **grub-pc_2.02~beta3-3** | + | |
| - | Now UUID is used multiple roots. UUID of btrfs filesystem placed on 2 disc is the same: | + | |
| - | <code bash> | + | |
| - | / | + | |
| - | / | + | |
| - | </ | + | |
| - | So, kernel cmdline parameter **'' | + | |
| - | + | ||
| - | === no symbol table === | + | |
| - | **PROBLEM** | + | |
| - | Grub says: | + | |
| - | < | + | |
| - | **SOLUTION** | + | |
| - | Grub was not reinstalled after update | + | |
| - | <code bash> | + | |
| - | grub-install /dev/sda | + | |
| - | grub-install /dev/sdb | + | |
| - | update-grub | + | |
| - | </ | + | |
| - | + | ||
| - | === ALERT! / | + | |
| - | + | ||
| - | **PROBLEM** | + | |
| - | Grub loads kernel and initramfs correctly, but: | + | |
| - | '' | + | |
| - | After some while, initramfs shell is available. | + | |
| - | < | + | |
| - | ALERT! | + | |
| - | Dropping to shell! | + | |
| - | </ | + | |
| - | + | ||
| - | Unfortunatelly initramfs cannot activate LVM volumes when kernel cmdline '' | + | |
| - | <code bash> | + | |
| - | lvm lvscan | + | |
| - | </ | + | |
| - | To boot manually: | + | |
| - | <code bash> | + | |
| - | lvm vgchange -ay | + | |
| - | mount / | + | |
| - | exit | + | |
| - | </ | + | |
| - | System should start - but once. | + | |
| - | + | ||
| - | Problem is located in ''/ | + | |
| - | Script check if specified root device needs to be activated by LVM. | + | |
| - | When UUID is used it is executing code: | + | |
| - | <code bash> | + | |
| - | /dev/*/*) | + | |
| - | # Could be /dev/VG/LV; use lvs to check | + | |
| - | if lvm lvs -- " | + | |
| - | lvchange_activate " | + | |
| - | fi | + | |
| - | ;; | + | |
| - | </ | + | |
| - | In result, command | + | |
| - | <code bash>lvm lvs -- disc/ | + | |
| - | is executed, resulting following output: | + | |
| - | < | + | |
| - | + | ||
| - | Debian bugs about similar problem: | + | |
| - | * [[https:// | + | |
| - | * [[https:// | + | |
| - | + | ||
| - | + | ||
| - | **solution** | + | |
| - | + | ||
| - | Install lvm2 package version 2.02.168-1 (Debian Stretch). Previously was 2.02.111-2.2+deb8u1 (Debian Jessie). | + | |
| - | <code bash> | + | |
| - | update-initramfs -k all -u | + | |
| - | btrfs scrub / | + | |
| - | </ | + | |
| - | + | ||
| - | or | + | |
| - | force LVM activation: [[http:// | + | |
| - | + | ||
| - | Also '' | + | |
| - | + | ||
| - | + | ||
| - | <file | / | + | |
| - | BINARIES="/ | + | |
| - | </ | + | |
| - | <code bash> | + | |
| - | + | ||
| - | ===== Disc fail (removed) ===== | + | |
| - | + | ||
| - | === error: disk not found === | + | |
| - | < | + | |
| - | error: disk ' | + | |
| - | Entering rescue mode... | + | |
| - | grub rescue> | + | |
| - | </ | + | |
| - | + | ||
| - | GRUB 2 is unable to find the grub folder or its contents are missing/ | + | |
| - | + | ||
| - | grub.cfg sets prefix variable to missing LVM (lvimd/< | + | |
| - | < | + | |
| - | prefix=' | + | |
| - | insmod gettext | + | |
| - | </ | + | |
| - | + | ||
| - | Rescue shell is very limited. Try to start '' | + | |
| - | < | + | |
| - | set prefix=' | + | |
| - | insmod normal | + | |
| - | normal | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | ===== Replace bad disc ===== | + | |
| - | + | ||
| - | <code bash> | + | |
| - | btrfs device add / | + | |
| - | btrfs device delete missing / | + | |
| - | btrfs fi balance / | + | |
| - | </ | + | |
| - | + | ||
| - | <code bash> | + | |
| - | btrfs filesystem show | + | |
| - | btrfs replace start 6 / | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Fine tuning ==== | + | |
| - | * Add your ssh public key to ''/ | + | |
| - | * Change MAC address of eth0 (for initramfs remote access) | + | |
| - | <file | / | + | |
| - | ACTION==" | + | |
| - | </ | + | |
| - | Another option is to add '' | + | |
| - | * | ||
| - | ==== TODO ==== | ||
| - | * backup GPT header | ||
| - | * backup LVM header | ||
| - | * backup LUKS header | ||