How to reduce image disk size

-1

My first board (let name it A) have NAND memory that contain all my system.

$fdisk -l

Disk /dev/nand: 3984 MB, 3984588800 bytes
255 heads, 63 sectors/track, 484 cylinders, total 7782400 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: 0x00000000

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

Disk /dev/nanda: 33 MB, 33554432 bytes
255 heads, 63 sectors/track, 4 cylinders, total 65536 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: 0x00000000

     Device Boot      Start         End      Blocks   Id  System

Disk /dev/nandb: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders, total 32768 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: 0x6f623a62

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

Disk /dev/nandc: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders, total 32768 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: 0xcdcdcdcd

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

Disk /dev/nandd: 3900 MB, 3900702720 bytes
255 heads, 63 sectors/track, 474 cylinders, total 7618560 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: 0x00000000

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

Disk /dev/mmcblk0: 32.0 GB, 32010928128 bytes
4 heads, 16 sectors/track, 976896 cylinders, total 62521344 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: 0xdb99a736

Usaly, to build another system equivalent to A I just copy the image from nandd of board A to nandd of board B:

$dd if=/dev/nandd of=./myimage.nandd

the size of myimage.nandd is 3900702720:

$ll
drwx------ 3 ubuntu ubuntu      16384 Jan  1  1970 ./
drwxr-xr-x 5 root   root         4096 Jan  1 00:00 ../
-rw-r--r-- 1 ubuntu ubuntu 3900702720 Dec 31 23:08 myimage.nandd

then, on the new board I proceed like:

$dd of=myimage.nandd if=/dev/nandd

My problem now is that I am having a new board (let name it C) that have the same architecture and everything except the nand disk:

fdisk -l

Disk /dev/nand: 3959 MB, 3959422976 bytes
255 heads, 63 sectors/track, 481 cylinders, total 7733248 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: 0x00000000

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

Disk /dev/nanda: 33 MB, 33554432 bytes
255 heads, 63 sectors/track, 4 cylinders, total 65536 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: 0x00000000

     Device Boot      Start         End      Blocks   Id  System

Disk /dev/nandb: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders, total 32768 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: 0x726f6e5f

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

Disk /dev/nandc: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders, total 32768 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: 0xcdcdcdcd

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

Disk /dev/nandd: 3875 MB, 3875536896 bytes
255 heads, 63 sectors/track, 471 cylinders, total 7569408 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: 0x00000000

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

The difference is just 25MB on nandd.

Note: When everything is installed in my Board A I still have more than 300MB of free space.

My question: How can I reduce the size of the disk image "myimage.nandd" by 25MB to fitt in my new board ?

Thank you

linux
resize
image-resizing
disk
dd

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0