...
DIP-SW is set to ON-ON. Refer to Selection of boot devices of SP7021 (Plus1) for details of boot selection.
...
At the first time, Linux boots from a new SD card. The built-in script of Linux will run fdisk command to extend the size of rootfs partition to the end of SD card and then re-boot. Refer to log while Linux script is extending size of rootfs partition:
Code Block |
---|
[ 1.801401706696] EXT4-fs (mmcblk1p2): mounting ext3 file system using the ext4 subsystem [ 1.838694793441] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null) [ 1.838915793709] VFS: Mounted root (ext3 filesystem) on device 179:262. [ 1.843410797172] devtmpfs: mounted [ 1.846602801289] Freeing unused kernel memory: 1024K [ 1.849267816633] Run /sbin/init as init process [ 1.913424] random: fast init done /etc/init.d/rcS starts... Mounting other filesystems ... rc.extra [bg] sdcard boot set... partition set 0x0000D8D60x00009BBA totalsize=1593153945615836643328 0x000000090x00000007 extra done totalsize=3111628030930936 startsector=206848 The number of cylinders for this disk is set to 486192483296. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): Disk /dev/mmcblk1: 15 GB, 1593153945615836643328 bytes, 3111628830930944 sectors 486192483296 cylinders, 4 heads, 16 sectors/track Units: sectors of 1 * 512 = 512 bytes Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type /dev/mmcblk1p1 0,32,33 12,223,19 2048 206847 204800 100M b Win95 FAT32 /dev/mmcblk1p2 12,223,20 1415,23310,2759 206848 239615241663 3276834816 1617.0M 83 Linux Command (m for help): Partition number (1-4): Command (m for help): Partition type p primary partition (1-4) e extended Partition number (1-4): First sector (16-3111628730930943, default 16): Last sector or +size{,K,M,G,T} (206848-3111628730930943, default 31116287 30930943): Command (m for help): Disk /dev/mmcblk1: 15 GB, 1593153945615836643328 bytes, 3111628830930944 sectors 486192483296 cylinders, 4 heads, 16 sectors/track Units: sectors of 1 * 512 = 512 bytes Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type /dev/mmcblk1p1 0,32,33 12,223,19 2048 206847 204800 100M b Win95 FAT32 /dev/mmcblk1p2 1023,3,16 1023,3,16 206848 3111628030930936 3090943330724089 14.7G6G 83 Linux Command (m for help): The partition table has been altered. Calling ioctl() to re-read partition table fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy End of /etc/init.d/rcS [ 3.682763396729] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) The system is going down NOW! Sent SIGTERM to all processes Sent SIGKILL to all processes Requesting system reboot [ 8.317512] reboot: Restarting system sp_restart +++iBoot v1.02 Jan 10 2019 11:20:28 -- B -- [d] iboot.c :96 |
The latest command in the script is reboot command. You’ll see system re-boot after script completes extending size of rootfs partition.
After system re-boots successfully, built-in script of Linux will run resize2fs to resize the root file-system to make use of the whole partition (It was extended in previous step.). It takes a while for completing resizing rootfs. Refer to screenshot log when resizing:
...
Code Block |
---|
[ 1.737678] EXT4-fs (mmcblk1p2): mounting ext3 file system using the ext4 subsystem
[ 1.752778] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.753050] VFS: Mounted root (ext3 filesystem) on device 179:26.
[ 1.756553] devtmpfs: mounted
[ 1.760744] Freeing unused kernel memory: 1024K
[ 1.879524] Run /sbin/init as init process
/etc/init.d/rcS starts...
Mounting other filesystems ...
rc.extra [bg]
sdcard boot set...
resize2fs partition
0x0000B37D
0x00000007
extra done
Filesystem at /dev/mmcblk1p2 is mounted on /; on-line resizing required
[ 2.221203] EXT4-fs (mmcblk1p2): resizing filesystem from 4352 to 3840511 blocks
old_desc_blocks = 1, new_desc_blocks = 1
[ 10.648447] random: crng init done
[ 12.290148] EXT4-fs (mmcblk1p2): resized to 1867776 blocks
[ 22.952843] EXT4-fs (mmcblk1p2): resized to 2686976 blocks
[ 33.218081] EXT4-fs (mmcblk1p2): resized to 3342336 blocks
[ 41.925326] EXT4-fs (mmcblk1p2): resized filesystem to 3840511
The filesystem on /dev/mmcblk1p2 is now 3840511 (4k) blocks long.
Filesystem Size Used Available Use% Mounted on
/dev/root 14.6G 9.9M 14.6G 0% /
devtmpfs 248.3M 0 248.3M 0% /dev
tmpfs 248.8M 0 248.8M 0% /dev/shm
tmpfs 248.8M 0 248.8M 0% /tmp
End of /etc/init.d/rcS
login[711]: root login on 'console'
~ # |
Resizing has completed. You are ready to use SP7021 Linux.
...
c) Press p to list partitions of the SD card again.
d) Press n and, p, 2, 104448206848 and then 31950839 31116279 to add back the second (rootfs) partition. Note that 104448 206848 is start-LBA while 31950839 31116279 is new end-LBA of the partition.
...