The typical format of the mount command is as follows.
mount [-t fstype] device dir
Figure 5.36. mount Command Format
The file system type is specified for
fstype
following the
-t
option
[3]
. For the FAT32 file system use
vfat
[4]
, and
for the EXT4 file system use
ext4
.
The device filename of the storage device is specified for
device
. For partition one of the SD card this will be
/dev/
mmcblk0p1
and for partition two it will be
/dev/mmcblk0p2
.
The directory where the file system on the storage device is to be mounted is specified for
dir
.
With the SDHC card inserted in the SD slot, execute the command shown in Figure 5.37, “Mounting Storage” to mount
the SDHC card file system on the /mnt directory. Files in the SD card become visible under the /mnt directory.
[armadillo ~]# mount -t vfat /dev/mmcblk0p1 /mnt
Figure 5.37. Mounting Storage
In order to safely remove storage it must be unmounted. The umount command is used to perform the unmounting. The
directory where the device to unmount is mounted is specified as its option.
[armadillo ~]# umount /mnt
Figure 5.38. Unmounting Storage
5.3.2. Changing and Formatting Storage Partitions
Normally, SDHC cards and USB memory just purchased have one partition and are formatted with the FAT32 file system.
If you want to change the partition configuration, use the fdisk command. An example of using the fdisk command to
divide the partition of an SD card configured with just that one partition into two partitions is shown in Figure 5.39, “Altering
Partitions with the fdisk Command”. After deleting the existing partition, two new primary partitions are created. 100Mbyte
is allocated to the first partition and the remaining capacity to the second partition. The first partition becomes /dev/
mmcblk0p1 and the second /dev/mmcblk0p2. For details on how to use the fdisk command, please refer to the man page
etc.
[armadillo ~]# fdisk /dev/mmcblk0
The number of cylinders for this disk is set to 62528.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
[3]
Specifying the file system type is optional. If omitted, the mount command guesses the type. This guess is not necessarily appropriate, so if the file
system type is known in advance, please explicitly specify it.
[4]
Normally, SDHC cards just purchased are formatted with the FAT32 file system.
Armadillo-IoT Gateway G3Product Manual - INTL
Operational Checks
71