Skip to content

Instantly share code, notes, and snippets.

@mitchese
Created June 23, 2017 21:00
Show Gist options
  • Save mitchese/7a3373132f94fc946b1cbeb2b04e7818 to your computer and use it in GitHub Desktop.
Save mitchese/7a3373132f94fc946b1cbeb2b04e7818 to your computer and use it in GitHub Desktop.
Example ros resize before booting
[2017-06-23 22:54:57] 594 mitchese@cspi-sm
:( $ sudo dd if=rancheros-raspberry-pi64.img of=/dev/mmcblk0 bs=1M
500+0 records in
500+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 118.057 s, 4.4 MB/s
[2017-06-23 22:57:14] 595 mitchese@cspi-sm
:) $ sudo fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.29.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/mmcblk0: 29.8 GiB, 32026656768 bytes, 62552064 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: 0x8dad7661
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 53247 51200 25M c W95 FAT32 (LBA)
/dev/mmcblk0p2 53248 1023999 970752 474M 83 Linux
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 has been deleted.
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (53248-62552063, default 53248):
Last sector, +sectors or +size{K,M,G,T,P} (53248-62552063, default 62552063):
Created a new partition 2 of type 'Linux' and of size 29.8 GiB.
Partition #2 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: n
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[2017-06-23 22:57:49] 597 mitchese@cspi-sm
:( $ sudo e2fsck -f /dev/mmcblk0p2
e2fsck 1.43.4 (31-Jan-2017)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 2000/121344 files (0.1% non-contiguous), 51867/121344 blocks
[2017-06-23 22:57:54] 598 mitchese@cspi-sm
:) $ sudo resize2fs /dev/mmcblk0p2
resize2fs 1.43.4 (31-Jan-2017)
Resizing the filesystem on /dev/mmcblk0p2 to 7812352 (4k) blocks.
The filesystem on /dev/mmcblk0p2 is now 7812352 (4k) blocks long.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment