SD卡启动,如何挂载剩余容量为overlayfs
-
小白根据教程编译的标准tina镜像,烧录SD卡启动,使用opkg安装应用时报只读错误.
翻阅论坛帖子和相关资料后了解到需要配置overlayfs才可以写入,尝试配置后依然无法工作,想问问各位大佬还有哪里需要修改?下面是我已经做的修改
修改.\device\config\chips\d1-h\configs\nezha\sys_partition.fex文件[partition] name = rootfs_data size = 8388608 downloadfile = "/home/ubt/tina-d1-h/fex/rootfs_data.fex" user_type = 0x8000
使用./out/host/bin/make_ext4fs创建文件系统,这里的null为空目录
home/ubt/tina-d1-h/out/d1-h-nezha/image/rootfs_data.fex /home/ubt/tina-d1-h/null Creating filesystem with parameters: Size: 8388608 Block size: 1024 Blocks per group: 8192 Inodes per group: 2048 Inode size: 256 Journal blocks: 1024 Label: Blocks: 8192 Block groups: 1 Reserved blocks: 0 Reserved block group size: 31 Created filesystem with 11/2048 inodes and 1575/8192 blocks
烧录运行后查看挂载情况,还是没有overlayfs挂载
root@TinaLinux:/# df -kh Filesystem Size Used Available Use% Mounted on /dev/root 15.8M 15.8M 0 100% / devtmpfs 492.8M 0 492.8M 0% /dev tmpfs 498.9M 32.0K 498.9M 0% /tmp /dev/mmcblk0p1 8.0M 66.0K 7.9M 1% /mnt/SDCARD root@TinaLinux:/# mount /dev/root on / type squashfs (ro,noatime) devtmpfs on /dev type devtmpfs (rw,relatime,size=504672k,nr_inodes=126168,mode=7 proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000) debugfs on /sys/kernel/debug type debugfs (rw,noatime) none on /sys/kernel/config type configfs (rw,relatime) adb on /dev/usb-ffs/adb type functionfs (rw,relatime) /dev/mmcblk0p1 on /mnt/SDCARD type vfat (rw,relatime,fmask=0000,dmask=0000,allowhortname=mixed,errors=remount-ro)
fstab文件
config 'mount' option target '/boot' option device '/dev/by-name/boot' option options 'ro,sync' option enabled '1' config 'mount' option target '/boot-res' option device '/dev/by-name/boot-res' option options 'ro,sync' option enabled '1' config 'mount' option target '/mnt/UDISK' option device '/dev/by-name/UDISK' option options 'rw,async' option enabled '0' config 'mount' option target '/overlay' option device '/dev/by-name/UDISK' option options 'rw,async' option enabled '1' config 'mount' option target '/mnt/SDCARD' option device '/dev/mmcblk0' option options 'rw,async' option enabled '1' config 'mount' option target '/mnt/SDCARD' option device '/dev/mmcblk0p1' option options 'rw,async' option enabled '1' config 'mount' option target '/mnt/exUDISK' option device '/dev/sda' option options 'rw,async' option enabled '1' config 'mount' option target '/mnt/exUDISK' option device '/dev/sda1' option options 'rw,async' option enabled '1'
-
root@TinaLinux:/# root@TinaLinux:/# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 17152 17152 0 100% /rom devtmpfs 26312 0 26312 0% /dev tmpfs 28412 32 28380 0% /tmp tmpfs 28412 20 28392 0% /tmp/root overlayfs:/tmp/root 28412 20 28392 0% / root@TinaLinux:/# root@TinaLinux:/# root@TinaLinux:/# mount /dev/root on /rom type squashfs (ro,relatime) devtmpfs on /dev type devtmpfs (rw,relatime,size=26312k,nr_inodes=6578,mode=755) proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755) overlayfs:/tmp/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000) debugfs on /sys/kernel/debug type debugfs (rw,noatime) none on /sys/kernel/config type configfs (rw,relatime) adb on /dev/usb-ffs/adb type functionfs (rw,relatime) root@TinaLinux:/# root@TinaLinux:/# root@TinaLinux:/# root@TinaLinux:/# ls /tmp/root/ upper work root@TinaLinux:/# root@TinaLinux:/#
看下我的
-
@yixiuge 请问是不是fstab文件还需要什么更改啊
-
补充一下,改完sys_partition.fex之后我执行了mboot和pack指令,起初我把make_ext4fs生成的文件放在out目录下,打包时似乎会直接被顶掉找不到,所以我后面放在外面了
-
又翻了遍手册,怎么感觉按默认配置什么都不改UDISK会自动分配剩余大小然后挂载到overlayfs的,但实际上不行?
config 'mount' option target '/overlay' option device '/dev/by-name/UDISK' option options 'rw,async' option enabled '1'
是否是overlayfs还需要什么配置才能启用?但是在defconfig文件内也没有找到
-
尝试更改了多次fstab和sys_partition文件都没什么用,注意到开机时有报错
formating /dev/by-name/UDISK to ext4 /etc/preinit: line 1: mkfs.ext4: not found formating /dev/by-name/rootfs_data to ext4 /etc/preinit: line 1: mkfs.ext4: not found
是因为没有成功创建ext4文件系统导致的?
-
-
@whycan 在 SD卡启动,如何挂载剩余容量为overlayfs 中说:
e2fsprogs
感谢大佬回复,还是不行
这是我现在运行的一些信息root@TinaLinux:/# df -kh Filesystem Size Used Available Use% Mounted on /dev/root 16.0M 16.0M 0 100% / devtmpfs 492.8M 0 492.8M 0% /dev tmpfs 498.9M 32.0K 498.9M 0% /tmp root@TinaLinux:/# mount /dev/root on / type squashfs (ro,noatime) devtmpfs on /dev type devtmpfs (rw,relatime,size=504672k,nr_inodes=126168,mode=755) proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000) debugfs on /sys/kernel/debug type debugfs (rw,noatime) none on /sys/kernel/config type configfs (rw,relatime) adb on /dev/usb-ffs/adb type functionfs (rw,relatime) root@TinaLinux:/# cd dev/ root@TinaLinux:/dev# ls mmcblk0 mmcblk0p1 mmcblk0p2 mmcblk0p3 mmcblk0p4 mmcblk0p5 mmcblk0p6 mmcblk0p7 mmcblk0p8 mmcblk0p9 ... root@TinaLinux:/dev# cd by-name/ root@TinaLinux:/dev/by-name# ls UDISK boot-resource env recovery rootfs_data boot dsp0 env-redund rootfs
我用的tf卡是一张16g的,被分成了9个分区,根据手册描述默认是加载第一个分区,和之前的运行情况一致.
当前fstab文件的配置config 'mount' option target '/mnt/UDISK' option device '/dev/by-name/UDISK' option options 'rw,async' option enabled '0' config 'mount' option target '/overlay' option device '/dev/by-name/UDISK' option options 'rw,async' option enabled '1' config 'mount' option target '/overlay' option device '/dev/by-name/rootfs_data' option options 'rw,sync' option enabled '1' config 'mount' option target '/mnt/SDCARD' option device '/dev/mmcblk0' option options 'rw,async' option enabled '1' config 'mount' option target '/mnt/SDCARD' option device '/dev/mmcblk0p1' option options 'rw,async' option enabled '0'
有个小疑问,这里都是将by-name目录下的udisk或者rootfs_data挂载到某一个分区,这个所谓的udisk/rootfs_data是怎么和实际设备mmcblk0联系起来的呢?
然后我也尝试了手动挂载,报错都是一样mount rootfs_data /overlay/ NTFS signature is missing. Failed to mount '/dev/mmcblk0p8': Invalid argument The device '/dev/mmcblk0p8' doesn't seem to have a valid NTFS.
无效的NTFS系统?是否和sd卡文件系统的格式有关?我是直接phoenixCard刷的
太多疑问了,搞不明白 -
mkfs.ext4 可以执行吗?
-
@whycan 不可以执行,提示找不到
-
贴日志看看。
-
@whycan 可以了!!!
root@TinaLinux:/# df -kh Filesystem Size Used Available Use% Mounted on /dev/root 16.3M 16.3M 0 100% /rom devtmpfs 492.8M 0 492.8M 0% /dev tmpfs 498.9M 32.0K 498.9M 0% /tmp /dev/by-name/rootfs_data 891.0K 49.0K 802.0K 6% /overlay overlayfs:/overlay 891.0K 49.0K 802.0K 6% / /dev/by-name/UDISK 13.1G 24.0K 13.1G 0% /mnt/UDISK root@TinaLinux:/# mount /dev/root on /rom type squashfs (ro,noatime) devtmpfs on /dev type devtmpfs (rw,relatime,size=504672k,nr_inodes=126168,mode=755) proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) /dev/by-name/rootfs_data on /overlay type ext4 (rw,relatime) overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000) debugfs on /sys/kernel/debug type debugfs (rw,noatime) none on /sys/kernel/config type configfs (rw,relatime) adb on /dev/usb-ffs/adb type functionfs (rw,relatime) /dev/by-name/UDISK on /mnt/UDISK type ext4 (rw,relatime)
刚才终于搞明白了fstab和sys_oartition.fex的对应关系重新配置了一下就可以了,现在是这么设置的
config 'mount' option target '/overlay' option device '/dev/by-name/rootfs_data' option options 'rw,async' option enabled '1' config 'mount' option target '/mnt/UDISK' option device '/dev/by-name/UDISK' option options 'rw,async' option enabled '1'
[partition] name = rootfs_data size = 2097152 downloadfile = "/home/ubt/tina-d1-h/fex/2Gb.fex" user_type = 0x8000 [partition] name = UDISK user_type = 0x8000
就是rootfs_data我设置的是2G,不知道为啥它变成891k了
这个2Gb.fex我是用这个rootfs_data.fex生成的 -
试了下不配置downloadfile也是可行的,初始化时可以根据大小自动格式化系统
formating /dev/by-name/UDISK to ext4 mke2fs 1.46.4 (18-Aug-2021) [ 4.827559] random: mkfs.ext4: uninitialized urandom read (16 bytes read) [ 4.835361] random: mkfs.ext4: uninitialized urandom read (16 bytes read) Creating filesystem with 3516935 4k blocks and 879552 inodes Filesystem UUID: 84f444b8-02d2-4035-b7b1-ec4f15a8f417 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208 Allocating group tables: done Writing inode tables: done Creating journal (16384 blocks): [ 6.281300] [ 6.281300] insmod_device_driver [ 6.281300] [ 6.288462] sunxi_usb_udc 4100000.udc-controller: 4100000.udc-controller supply udc not found, using dummy regulator [ 6.321295] hdmi_hpd_sys_config_release done Writing superblocks and filesystem accounting information: done formating /dev/by-name/rootfs_data to ext4 mke2fs 1.46.4 (18-Aug-2021) [ 17.598480] random: mkfs.ext4: uninitialized urandom read (16 bytes read) [ 17.606271] random: mkfs.ext4: uninitialized urandom read (16 bytes read) Creating filesystem with 262144 4k blocks and 65536 inodes Filesystem UUID: 56bbb4d6-0db1-47ec-a35c-f66492e4fdad Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Allocating group tables: done Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done
就是大小还不太对,我再研究下
总之还是感谢大佬帮助 -
@allwinner_account 我也遇到这个问题,修改partion的rootfs_data size,最后pack出来的overlay还是不变,请问你后来找到原因了吗?
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号