milkv-pioneer / issues

5 stars 0 forks source link

SD 卡没有自动扩容 #16

Open u0076 opened 1 year ago

u0076 commented 1 year ago

现象描述: 使用 Fedora 38,发现根文件系统没有自动扩展分区。

问题原因: 当前的 Fedora 系统没有内置扩展分区功能。

处理方式: 下一版加入自动扩展分区功能。

跟进人:傅炜

197788 commented 1 month ago

In RevyOS, there is a script included in /opt called "firstboot.sh.done" I think it gets run on first boot, because you have the full disksize immediately after you write the .img file and boot up on first boot. This is the code:

#!/bin/bash

# use all nvme free space for rootfs
dev=$(mount | grep " / " | cut -d " " -f 1 | cut -d 'p' -f 1)
dev_num=$(mount | grep " / " | cut -d " " -f 1 | cut -d 'p' -f 2)

parted ${dev} ---pretend-input-tty <<EOF
resizepart
${dev_num}
Yes
100%
quit
EOF
# resize root filesystem
resize2fs /dev/disk/by-label/revyos-root

# regenerate openssh host keys
dpkg-reconfigure openssh-server
systemctl restart ssh