Linux CT Development Board to NAND partition, get 8G space

Source: Internet
Author: User

Df-h View Results:

The code is as follows Copy Code
root@cubietruck:~# df-h
FileSystem Size Used Avail use% mounted on
/dev/root 2.0G 614M 1.3G 32%/
Devtmpfs 889M 4.0K 889M 1%/dev
None 4.0K 0 4.0K 0%/sys/fs/cgroup
Tmpfs 20M 0 20M 0%/tmp
None 197M 148K 197M 1%/run
None 5.0M 0 5.0M 0%/run/lock
None 985M 0 985M 0%/run/shm
None 100M 0 100M 0%/run/user

Fdisk-l View Results:

The code is as follows Copy Code

disk/dev/nand:7700 MB, 7700742144 bytes
255 heads, Sectors/track, 936 cylinders, total 15040512 sectors
Units = sectors of 1 * the bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/nand doesn ' t contain a valid partition table

disk/dev/nanda:67 MB, 67108864 bytes
255 heads, Sectors/track, 8 cylinders, total 131072 sectors
Units = sectors of 1 * the bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Device Boot Start End Blocks Id System

disk/dev/nandb:2147 MB, 2147483648 bytes
255 heads, Sectors/track, 261 cylinders, total 4194304 sectors
Units = sectors of 1 * the bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/nandb doesn ' t contain a valid partition table

disk/dev/nandc:5469 MB, 5469372416 bytes
255 heads, Sectors/track, 664 cylinders, total 10682368 sectors
Units = sectors of 1 * the bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk IDENTIFIER:0XFFFFFFFF

Disk/dev/nandc doesn ' t contain a valid partition table

Solution:
Nand-part NAND device start position ' partition name length ' partition Name 2 length 2 '

Running Nand-part directly will get the partition information:
Bootloader starting position 32768 length 131072
Rootfs starting position 163840 length 4194304
Udisk starting position 4358144 length 10584064

These numbers are in 512-byte units.

Where Rootfs is the system file partition, and Udisk is that 5G more, and our goal is to the 5G of space, merged into the Rootfs, recalculated a bit, get the command is:
Nand-part/dev/nand 32768 ' bootloader 131072 ' Rootfs 14778368 '

The meaning is to/dev/nand, the starting position and length of the bootloader must remain unchanged, otherwise the consequence is to brush the system. In this case, the starting position of the Rootfs is also the original position, the change is its length, 14778368. Capacity calculation is: 14778368*512/1024/1024=7216MB, that is, 7G, of course, because the front has bootloader partition, and bootloader before the empty piece, So nandb is naturally not getting the full 8G.
Command successfully executed, reboot, and then Resize2fs/dev/nandb succeeded.

Verify:

The code is as follows Copy Code
root@cubietruck:~# df-h
FileSystem Size Used Avail use% mounted on
/dev/root 7.0G 614M 6.2G 9%/
Devtmpfs 889M 4.0K 889M 1%/dev
None 4.0K 0 4.0K 0%/sys/fs/cgroup
Tmpfs 20M 0 20M 0%/tmp
None 197M 148K 197M 1%/run
None 5.0M 0 5.0M 0%/run/lock
None 985M 0 985M 0%/run/shm
None 100M 0 100M 0%/run/user


You can see that the root directory has become 7 G.

Results of Fdisk-l:

The code is as follows Copy Code

root@cubietruck:~# fdisk-l

disk/dev/nand:7700 MB, 7700742144 bytes
255 heads, Sectors/track, 936 cylinders, total 15040512 sectors
Units = sectors of 1 * the bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/nand doesn ' t contain a valid partition table

disk/dev/nanda:67 MB, 67108864 bytes
255 heads, Sectors/track, 8 cylinders, total 131072 sectors
Units = sectors of 1 * the bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Device Boot Start End Blocks Id System

disk/dev/nandb:7616 MB, 7616856064 bytes
255 heads, Sectors/track, 926 cylinders, total 14876672 sectors
Units = sectors of 1 * the bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00000000

Disk/dev/nandb doesn ' t contain a valid partition table

You can see that the/DEV/NANDB has also become 7616M.

Original from: blog.slogra.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.