树莓派os64位版本 ext4默认文件系统转换为btrfs的步骤

树莓派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


  

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值