40 lines
1.1 KiB
Markdown
40 lines
1.1 KiB
Markdown
|
# Running a Raspberry Pi with USB based btrfs root filesystem
|
||
|
|
||
|
This is a very advanced configuration and here as a set of notes for the more daring users building remixes.
|
||
|
|
||
|
Please note: *you will need to change ```/dev/sda``` and ```/dev/sdb``` as well as any sizes and offsets to match your needs and approach*.
|
||
|
|
||
|
``` bash
|
||
|
|
||
|
dd if=/dev/sda of=/dev/sdb bs=1M
|
||
|
parted /dev/sdb
|
||
|
mkpart
|
||
|
33G
|
||
|
-1
|
||
|
q
|
||
|
mkfs.btrfs \
|
||
|
-L writable \
|
||
|
/dev/sdb3
|
||
|
mkdir /mnt/new
|
||
|
mkdir /mnt/orig
|
||
|
mount /dev/sdb2 /mnt/orig
|
||
|
mount -o autodefrag,compress,ssd,ssd_spread /dev/sdb3 /mnt/new
|
||
|
rsync -aPr --delete-after /mnt/orig/ /mnt/new/
|
||
|
nano -w /mnt/new/etc/fstab
|
||
|
btrfs filesystem type && mount options
|
||
|
mount /dev/sdb1 /mnt/new/boot/firmware
|
||
|
nano -w /mnt/new/boot/firmware/config.txt /mnt/new/boot/firmware/cmdline.txt
|
||
|
umount /mnt/orig
|
||
|
pvcreate /dev/sdb2
|
||
|
vgcreate misc /dev/sdb2
|
||
|
lvcreate -C y -n swap.1 -L 1G misc
|
||
|
lvcreate -n scratch -L 6G misc
|
||
|
mkswap /dev/mapper/misc-swap.1
|
||
|
mkfs.btrfs -L scratch /dev/mapper/misc-scratch
|
||
|
mkdir /scratch
|
||
|
nano -w /mnt/new/etc/fstab
|
||
|
add lvm swap
|
||
|
add lvm scratch
|
||
|
|
||
|
```
|