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/19 14:33] – niziak | linux:fs:btrfs_as_root2 [2025/03/24 08:32] (current) – ↷ Links adapted because of a move operation niziak | ||
---|---|---|---|
Line 8: | Line 8: | ||
- configure system to start with degraded disc, include btrfs tools in initramfs | - configure system to start with degraded disc, include btrfs tools in initramfs | ||
- | ===== sdb partioning | + | ===== /dev/sdb partitioning |
- /dev/sdb | - /dev/sdb | ||
- 1MB free space + alignment | - 1MB free space + alignment | ||
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 | ||
- | </ | ||
- | |||
- | **PROBLEM** | ||
- | Grub incorrectly handle multiple roots. Internal variable ${GRUB_DEVICE} which is used to generate '' | ||
- | < | ||
- | | ||
- | / | ||
- | </ | ||
- | More here: [[https:// | ||
- | |||
- | Fixed in Debian Stretch (testing) version **grub-pc_2.02~beta3-3** | ||
- | |||
- | |||
- | **PROBLEM** | ||
- | Grub says: | ||
- | < | ||
- | **SOLUTION** | ||
- | Grub was not installed after update | ||
- | <code bash> | ||
- | grub-install /dev/sda | ||
- | grub-install /dev/sdb | ||
- | update-grub | ||
- | </ | ||
- | |||
- | **PROBLEM** | ||
- | '' | ||
- | After some while, initramfs shell is available. | ||
- | < | ||
- | ALERT! | ||
- | Dropping to shell! | ||
- | </ | ||
- | |||
- | '' | ||
- | <code bash> | ||
- | lvm vgchange -ay | ||
- | mount / | ||
- | exit | ||
- | </ | ||
- | System should start | ||
- | <code bash> | ||
- | vgchange -a y | ||
- | update-initramfs -k all -u | ||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | Also '' | ||
- | |||
- | |||
- | <file | / | ||
- | BINARIES="/ | ||
- | </ | ||
- | <code bash> | ||
- | |||
- | ===== Replace bad disc ===== | ||
- | |||
- | <code bash> | ||
- | btrfs device add / | ||
- | btrfs device delete missing / | ||
- | btrfs fi balance / | ||
- | </ | ||
- | |||
- | <code bash> | ||
- | btrfs filesystem show | ||
- | btrfs replace start 6 / | ||
- | </ | ||
- | ==== TODO ==== | ||
- | * backup GPT header | ||
- | * backup LVM header | ||
- | * backup LUKS header | ||