Embedded system to increase file system partition

Recent work need to add a form of fat in the arm architecture board for windows file system partition access, you look back a bit and linux file system partitions. Simply write a few words:

Storage medium is a card eMMC, linux system, using cross-compiler. Increase partition directly in fastboot parameters passed to the kernel to add a partition just fine, nothing to say.

Here mainly talk about increasing the file system in two ways:

 

method one

1. Prepare on the host, and then burned to a corresponding partition:

  dd if=/dev/zero of=data.fat bs=1024 count=1024

  If the count is too small here, then, when executed mkfs.fat will remind error: Not enough space to build proposed filesystem while setting up superblock

  This is because the head of the file system will start to write out the partition MBR, recording information of the file system, if the block is too small, write no less then will complain, the specific file system have the opportunity to write a blog.

  mkfs.fat data.fat -F 32

  -F 32 here is to specify the fat32 file system, you can also choose fat12, fat16 according to their needs, any fat32 one, of course, can not be specified, the default is fine.

  Then file data.fat you can see the file system has been formatted well: data.vfat: DOS / MBR boot sector, code offset 0x3c + 2, OEM-ID "mkfs.fat", sectors / cluster 4, root entries 512, sectors 2048 (volumes <= 32 MB), Media descriptor 0xf8, sectors / FAT 2, sectors / track 32, heads 64, serial number 0xbfc1387d, unlabeled, FAT (12 bit)

  Data.fat then burn to partition corresponding to

 

Method Two

2. On the target machine start running script:

  Add the following shell script /init.d/rcS in:

 

mount /dev/mmcblkmpn /
if [ $? -ne 0 ]; then
    mkfs.fat /dev/mmcblkmpn -F 32
    mount /dev/mmcblkmpn /
fi

  Wherein mmcblkmpn corresponding file system partitions

A recommended method, because the second method may risk losing data after a failure to mount file systems

 

all of above.

Guess you like

Origin www.cnblogs.com/live-program/p/10994104.html