-
使用
Win32DiskImager
烧录官方镜像 -
禁用自动扩容
-
挂载刚刚制作的TF卡镜像
mkdir -p /mnt/usb mount /dev/sda1 /mnt/usb
-
从
zero2
中得知禁用自动扩容方法是在/root下建立一个.no_rootfs_resize
文件 -
使用parted扩容空间,空间大小根据实际的开发环境需要占用的大小而定
root@orangepipcplus:~# parted /dev/sda GNU Parted 3.2 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Model: Generic STORAGE DEVICE (scsi) Disk /dev/sda: 31.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 4194kB 1183MB 1179MB primary ext4 (parted) resizepart Partition number? 1 Warning: Partition /dev/sda1 is being used. Are you sure you want to continue? Yes/No? yes End? [1183MB]? 2355 (parted) p Model: Generic STORAGE DEVICE (scsi) Disk /dev/sda: 31.9GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 4194kB 2355MB 2351MB primary ext4 (parted) quit Information: You may need to update /etc/fstab.
-
把扩容更新到fs,然后重启由TF卡引导系统
root@orangepipcplus:~# resize2fs /dev/sda1 resize2fs 1.44.1 (24-Mar-2018) Filesystem at /dev/sda1 is mounted on /mnt/usb; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/sda1 is now 573927 (4k) blocks long.
-
启动成功后,
df -h
查验是否由TF启动和扩容是否是自己所设定的,然后配置开发环境
-
-
使用
dd
制作镜像文件-
配制好开发环境后删除
/root/.no_rootfs_resize
文件并启用自动扩容服务systemctl enable orangepi-resize-filesystem.service
,然后使用读卡器挂载TF卡,并使用一个U盘用于保存导出的镜像root@orangepipcplus:~# fdisk -l Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/mmcblk2: 7.3 GiB, 7818182656 bytes, 15269888 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: 0x143bb244 Device Boot Start End Sectors Size Id Type /dev/mmcblk2p1 8192 15117183 15108992 7.2G 83 Linux Disk /dev/zram0: 50 MiB, 52428800 bytes, 12800 sectors Units: sectors of 1 * 4096 = 4096 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/zram1: 499.8 MiB, 524042240 bytes, 127940 sectors Units: sectors of 1 * 4096 = 4096 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/sda: 29.7 GiB, 31914983424 bytes, 62333952 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: 0xfcb4f8cd Device Boot Start End Sectors Size Id Type /dev/sda1 8192 4599609 4591418 2.2G 83 Linux Disk /dev/sdb: 14.5 GiB, 15518924800 bytes, 30310400 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: gpt Disk identifier: 7F32D357-83F8-46EE-9837-A0CE0DD5FB90 Device Start End Sectors Size Type /dev/sdb1 2048 30308351 30306304 14.5G Microsoft basic data
-
挂载U盘并导出TF卡中的镜像
mount /dev/sdb1 /mnt/usb cd /mnt/usb dd if=/dev/sda of=dev-2021-3-23.img bs=1M count=2355
-
-
然后使用
Win32DiskImager
烧录验证