meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:fs:btrfs_as_root2 [2017/01/19 14:35] niziaklinux: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't be included in snapshot of parent volume. Like some /var/../cache, etc **NOTE:** Create subvolumes for things which shouldn't be included in snapshot of parent volume. Like some /var/../cache, etc
 +
 +[[https://wiki.archlinux.org/index.php/Snapper#Suggested_filesystem_layout]]
  
 <code bash> <code bash>
Line 119: Line 121:
  
 Create subvolumes: Create subvolumes:
-<code>+<code bash>
 cd /mnt cd /mnt
 btrfs subvolume create @pool btrfs subvolume create @pool
Line 130: Line 132:
 </file> </file>
  
 +[[https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Btrfs_on_top_of_dmcrypt]]
 ===== 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  /dev/sda < parts +
-</code>+
  
-Recreate LVM layout. 
- 
-Add 2nd disc to btrfs: 
-<code bash> 
-btrfs device add /dev/disc1/btrfs1 /  
-btrfs device usage / 
-btrfs balance start -v -dconvert=raid1 -mconvert=raid1 / 
-btrfs device usage / 
-</code> 
- 
-Let system boot without one disc: 
-<file | /etc/default/grub> 
-GRUB_CMDLINE_LINUX_DEFAULT="rootflags=degraded" 
-</file> 
-<code bash>update-grub</code> 
- 
-Install grub 
-<code bash> 
-sudo grub-install /dev/sdb 
-sudo grub-install /dev/sdc 
-</code> 
- 
-**PROBLEM** 
-Grub incorrectly handle multiple roots. Internal variable ${GRUB_DEVICE} which is used to generate ''root='' parameter include newline character, so grub cannot boot: 
-<code> 
-       linux<->/@/@root/boot/vmlinuz-4.8.0-0.bpo.2-amd64 root=/dev/mapper/disc2-btrfs2 
-/dev/mapper/disc1-btrfs1 ro rootflags=subvol=@/@root  rootflags=degraded 
-</code> 
-More here: [[https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1238347]] and [[https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1582811]] 
- 
-Fixed in Debian Stretch (testing) version **grub-pc_2.02~beta3-3** 
- 
- 
-**PROBLEM** 
-Grub says: 
-<code>grub error: no symbol table</code> 
-**SOLUTION** 
-Grub was not installed after update 
-<code bash> 
-grub-install /dev/sda 
-grub-install /dev/sdb 
-update-grub 
-</code> 
- 
-**PROBLEM** 
-''Begin: Waiting for root file system ...'' and Grub still boot into initramfs. 
-After some while, initramfs shell is available. 
-<code> 
-ALERT!  
-Dropping to shell! 
-</code> 
- 
-''lvm lvscan'' shows that all volumes are inactive 
-<code bash> 
-lvm vgchange -ay 
-mount /dev/disc2/btrfs2 /root -o device=/dev/disc1/btrfs1 
-exit 
-</code> 
-System should start 
-<code bash> 
-vgchange -a y 
-update-initramfs -k all -u 
-btrfs scrub / 
-</code> 
- 
- 
- 
- 
- 
-Also ''GRUB_DISABLE_OS_PROBER=true'' can be added. 
- 
- 
-<file | /etc/mkinitcpio.conf> 
-BINARIES="/bin/btrfs" 
-</file> 
-<code bash>update-init -u -k all</code> 
- 
-===== Replace bad disc ===== 
- 
-<code bash> 
-btrfs device add /dev/disc3/btrfs3 / 
-btrfs device delete missing / 
-btrfs fi balance / 
-</code> 
- 
-<code bash> 
-btrfs filesystem show 
-btrfs replace start 6 /dev/disc3/btrfs3 /  # change 6 to your setup 
-</code> 
  
-==== TODO ==== 
-  * backup GPT header 
-  * backup LVM header 
-  * backup LUKS header