> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Customize storage features

This section explains how to customize the storage features, such as adding a new partition and mounting the SD card to a specific path.

<Note>
  All Qualcomm SoC UFS device components are validated for the preferred vendor list (PVL). Select the applicable part from the [Memory list](https://www.qualcomm.com/products/internet-of-things/industrial/building-enterprise/qcs6490/peripherals).
</Note>

## Mount the file system

EXT4 is an open-source file system that's used on data partitions on the Qualcomm Linux. The EXT4 file system can support volumes with sizes up to 64 ZB, and single files with sizes up to 16 TB with the standard 4 kB block size. For more information about EXT4, see [https://opensource.com/article/17/5/introduction-ext4-filesystem](https://opensource.com/article/17/5/introduction-ext4-filesystem).

An extent is a range of contiguous physical blocks, improving large-file performance and reducing fragmentation. A single extent in EXT4 can map up to 128 MiB of contiguous space with a 4 kB block size. EXT4 doesn't limit the number of subdirectories in a single directory, except by the inherent size limit of the directory itself.

For example:

```bash theme={null}
/dev/sda3 on /usr type ext4 (ro,relatime,inlinecrypt)
```

1. Mount `/dev/sda3` to `/data`.

   ```bash theme={null}
   mkdir /tmp/data
   ```

   ```bash theme={null}
   mount -o rw,remount /
   ```

   ```bash theme={null}
   mount -t ext4 /dev/sda3 /tmp/data
   ```

2. Verify whether the `/dev/sda3` partition is mounted.

   ```bash theme={null}
   df -ah
   ```

   Output:

   ```
   ...
   Filesystem     Size    Used  Avail  Use%  Mounted on

   /dev/sda3      108.2G  3.7G  99.9G  4%    /tmp/data
   ```

3. Mount a file system with specific SELinux context options.

   ```bash theme={null}
   mount -o rootcontext=system_u:object_r:etc_t:s0 -t ext4 /dev/sda3 /home/root/data
   ```

<Note>
  Run the `mount` command to retrieve the exact `rootcontext=<>` value related to the `/dev/sda3`.
</Note>

## Mount the SD card to a specific path

SD cards are automounted on card insertion. To manually mount the SD card, run the following commands:

1. Remount the root partition as read or write-enabled.

   ```bash theme={null}
   mount -o rw,remount /
   ```

2. Create an SD card directory.

   ```bash theme={null}
   mkdir sdcard
   ```

3. Locate the default path for the SD card directory.

   ```bash theme={null}
   root@qcs6490-rb3gen2-vision-kit:~# pwd
   ```

   Output:

   ```
   / (<-- default path)
   ```

4. If the SD card isn't formatted as VFAT, format it using the following command.

   ```bash theme={null}
   mkfs.vfat /dev/mmcblk1p1
   ```

5. Mount the SD card to the default path (`/sdcard`).

   ```bash theme={null}
   mount -t vfat /dev/mmcblk1p1 /<default_path>/sdcard
   ```

   <Note>
     If the SD card has multiple partitions, repeat step 4 to mount each partition.
   </Note>

6. Verify whether the SD card is mounted.

   ```bash theme={null}
   df -a
   ```

   Output:

   ```
   ...
   Filesystem      Size    Used  Avail  Use%  Mounted on
   /dev/mmcblk1p1  511.0M  4.0K  511.0M  0%   /sdcard
   ```

## Mount the NVMe card

To format and mount the new or existing NVMe cards using `fdisk`, do the following:

1. Create a partition table by running the following command.

   ```bash theme={null}
   fdisk /dev/nvme0n1
   ```

   Output:

   ```
   Command (m for help): i
   No partition is defined yet!
   Command (m for help): n
   Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
   Select (default p):  (press enter)
   Using default response p.
   Partition number (1-4, default 1):  (press enter)
   First sector (2048-1953525167, default 2048):  (press enter)
   Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-1953525167, default 1953525167):
   Created a new partition 1 of type 'Linux' and of size 931.5 GiB.
   Command (m for help): w
   The partition table has been altered.
   Syncing disks.
   root@lemans:~#
   ```

2. Reboot the board.

   <Note>
     Locate the `mkfs.ext4` binary at `/usr/sbin/mkfs.ext4`.
   </Note>

3. Format the `/dev/nvme0n1p1` partition.

   ```bash theme={null}
   mkfs.ext4 /dev/nvme0n1p1
   ```

   Output:

   ```
   mke2fs 1.46.5 (30-Dec-2021)
   Discarding device blocks: done
   Creating filesystem with 244190390 4k blocks and 61054976 inodes
   Filesystem UUID: 94ca7f8e-eb27-45ce-84f6-67f0cf977ca8
   Superblock backups stored on blocks:
   32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
   4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
   102400000, 214990848
   Allocating group tables: done
   Writing inode tables: done
   Creating journal (262144 blocks): done
   Writing superblocks and filesystem accounting information: done
   ```

4. Mount the NVMe partition1 to the media folder.

   ```bash theme={null}
   mount /dev/nvme0n1p1 /media
   ```

5. Verify whether the `nvme0n1p1` partition is mounted.

   ```bash theme={null}
   df -a
   ```

   Output:

   ```
   ...
   Filesystem      Size  Used  Avail  Use%  Mounted on
   /dev/nvme0n1p1  458G   28K  435G   1%    /var/rootdirs/media
   ```
