1. 制作镜像,挂载等
dd if=/dev/mmcblk0 of=ext4.img bs=512 count=131072 //if是输入,of是输出, 镜像大小为64M
mkfs.ext4 ext4.img //格式化ext4.img成ext4格式
mount ext4.img /mnt/ //修改镜像里内容
修改/mnt/ 目录里内容
unmount /mnt/
dd if=/root/gpt32.img of=/dev/mmcblk0 //
mkfs.ext4 -F /dev/mmcblk0p4
mount -t ext4 /dev/mmcblk0p3 /mnt/
修改/mnt里内容
umount /dev/mmcblk0p3
2. 插入sd卡,查看分区并挂载
fdisk -l
root@linaro-developer:~/post_install# fdisk -l
Disk /dev/mmcblk1: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb5edaa84
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 2048 440319 438272 214M c W95 FAT32 (LBA)
/dev/mmcblk1p2 440320 31116287 30675968 14.6G 83 Linux
挂载上来
mount -t ext4 /dev/mmcblk1p2 /mnt 挂在ext4分区
mount -t vfat /dev/mmcblk1p1 /mnt/ 挂载fat32分区