caiwang / board2ihost

0 stars 0 forks source link

extend disk space #37

Open caiwang opened 9 years ago

caiwang commented 9 years ago

Issue by caiwang Saturday Feb 28, 2015 at 12:15 GMT Originally opened as https://github.com/caiwang/ihostsrc/issues/37


root@radxa:~# fdisk -l

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 17 heads, 48 sectors/track, 38132 cylinders, total 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 Disk identifier: 0xb059dc39

    Device Boot      Start         End      Blocks   Id  System

/dev/mmcblk0p1 131072 15730687 7799808 83 Linux root@radxa:~#

root@radxa:~# fdisk /dev/mmcblk0 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x4b78d326. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): w The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.

root@radxa:~# partprobe root@radxa:~# fdisk /dev/mmcblk0

Command (m for help): p

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 17 heads, 48 sectors/track, 38132 cylinders, total 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 Disk identifier: 0xb059dc39

    Device Boot      Start         End      Blocks   Id  System

/dev/mmcblk0p1 131072 15730687 7799808 83 Linux

Command (m for help): d Selected partition 1

Command (m for help): p

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 17 heads, 48 sectors/track, 38132 cylinders, total 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 Disk identifier: 0xb059dc39

    Device Boot      Start         End      Blocks   Id  System

Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): Using default response p Partition number (1-4, default 1): Using default value 1 First sector (2048-31116287, default 2048): 131072 Last sector, +sectors or +size{K,M,G} (131072-31116287, default 31116287): +3700M

Command (m for help): p

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 17 heads, 48 sectors/track, 38132 cylinders, total 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 Disk identifier: 0xb059dc39

    Device Boot      Start         End      Blocks   Id  System

/dev/mmcblk0p1 131072 7708671 3788800 83 Linux

Command (m for help): w The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. root@radxa:~# partprobe Error: Error informing the kernel about modifications to partition /dev/mmcblk0p1 -- Invalid argument. This means Linux won't know about any changes you made to /dev/mmcblk0p1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting. Error: Partition(s) 1 on /dev/mmcblk0 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. root@radxa:~#

caiwang commented 9 years ago

Comment by caiwang Sunday Mar 01, 2015 at 03:37 GMT


root@radxa:~# resize2fs /dev/mmcblk0p1 resize2fs 1.42.9 (4-Feb-2014) Filesystem at /dev/mmcblk0p1 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p1 to 1949952 (4k) blocks. The filesystem on /dev/mmcblk0p1 is now 1949952 blocks long.

root@radxa:~# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/mmcblk0p1 ext4 7.4G 567M 6.4G 8% / udev devtmpfs 932M 60K 932M 1% /dev none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup none tmpfs 187M 204K 187M 1% /run none tmpfs 5.0M 0 5.0M 0% /run/lock none tmpfs 935M 0 935M 0% /run/shm none tmpfs 100M 0 100M 0% /run/user