树莓派os64位版本 ext4默认文件系统转换为btrfs的步骤
1. flash raspberry OS img file in sdcard and ssd
2. boot ssd raspberry OS system
2.1 Prepare initramfs
2.1.1 boot ssd raspberry OS system
2.1.2 In Raspbian btrfs is included as module. In order to make the kernel mount a btrfs root filesystem, we need to build the corresponding initramfs. First install the necessary tools
sudo sed 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list -i
sudo apt update
sudo apt install initramfs-tools btrfs-progs
2.1.3 Now we add the btrfs module to /etc/initramfs-tools/modules
$ vi /etc/initramfs-tools/modules
btrfs
xor
zlib_deflate
raid6_pq
2.1.4 Next is to build the initramfs
$ sudo mkinitramfs -o /boot/initramfs-btrfs.gz
$ sudo cp /boot/initramfs-btrfs.gz /boot/firmware/initramfs-btrfs.gz
2.1.5 And tell the bootloader to load the initramfs, by editing /boot/config.txt or editing /boot/firmware/config.txt
$sudo vi /boot/firmware/config.txt
# For more options and informations see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
initramfs initramfs-btrfs.gz
2.2. Edit /etc/fstab
$sudo nano /etc/fstab
proc /proc proc defaults 0 0
PARTUUID=4301c17b-01 /boot vfat defaults 0 2
PARTUUID=4301c17b-02 / btrfs defaults,noatime 0 0
2.3. Edit /boot/firmware/cmdline.txt, changed to "rootfstype=btrfs","fsck.repair=no"
$sudo nano /boot/firmware/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=a0683fcf-02 rootfstype=btrfs elevator=deadline fsck.repair=no rootwait
2.4. change to next disk boot, in the next disk boot system use btrfs-convert change this disk filesystem to btrfs
$sudo raspi-config
select boot order to sdcard first
3. in sdcard boot system
3.1 install btrfs-progs
$ sudo apt install btrfs-progs
3.2 convert ssd file system to btrfs
$ sudo btrfs-convert /dev/nvmexxxx02
3.3 change boot order
$ sudo raspi-config
select boot order to nvme first

被折叠的 条评论
为什么被折叠?



