# Adding An NVMe Drive

**URL:** <https://forums.balena.io/t/adding-an-nvme-drive/349728>\
**Category:** balenaOS\
**Created:** [October 17, 2021, 11:10pm UTC](https://forums.balena.io/t/adding-an-nvme-drive/349728 "2021-10-17T23:10:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WestCoastDaz](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@WestCoastDaz](https://forums.balena.io/u/WestCoastDaz)\
**Post date:** [October 17, 2021, 11:10pm UTC](https://forums.balena.io/t/adding-an-nvme-drive/349728/1 "2021-10-17T23:10:16Z")

</div>

Hi I’m trying to add an NVMe to my CM4 IO board but am little lost. I have seen this [post](https://forums.balena.io/t/postgres-database-persistent-storage-on-nvme-ssd-instead-of-sd-card/346106) but it seems quite complicated.

My goal is to use the NVMe as the backing store for a SAMBA container. So my questions are:

1. How do I go about getting BalenaOS to see my NVMe drive?
2. Do I need to format the drive and give it a volume name before using the drive? If so would it be easier to do this outside Balena?

Thanks,

---

<div class="post-metadata">

**Author:** ![ts-cfield](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ts-cfield/32/6603_2.png) [@ts-cfield](https://forums.balena.io/u/ts-cfield)\
**Post date:** [October 21, 2021, 3:09pm UTC](https://forums.balena.io/t/adding-an-nvme-drive/349728/2 "2021-10-21T15:09:33Z")

</div>

Hello,

I am not totally familiar with the CM4 IO board nor am I familiar with configuring a SAMBA container, but I set up the [NVMe for my Jetson board](https://forums.balena.io/t/postgres-database-persistent-storage-on-nvme-ssd-instead-of-sd-card/346106) with the following, high-level procedure:

1. Install BalenaOS on the board. Instructions vary depending on board. See Balena’s documentation for your specific board.

2. Log into the host via SSH.

3. I believe the parted command line application is available in the BalenaOS host. I followed the [How to Partition and Format Storage Devices in Linux](https://www.digitalocean.com/community/tutorials/how-to-partition-and-format-storage-devices-in-linux) tutorial by DigitalOcean to format the NVMe SSD.

4. Add `ENV UDEV=1` to dockerfile for the service/container.

5. Create an initialization shell script that mounts the NVMe.

6. Add the initialization shell script as an entrypoint to the dockerfile and provide the default command. This will be highly specific to the samba container you are using, so the following is _not_ going to work and is meant for demonstration.

---

<div class="post-metadata">

**Author:** ![WestCoastDaz](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@WestCoastDaz](https://forums.balena.io/u/WestCoastDaz)\
**Post date:** [October 22, 2021, 3:43pm UTC](https://forums.balena.io/t/adding-an-nvme-drive/349728/3 "2021-10-22T15:43:55Z")

</div>

@ts-cfield

Thank you for you very detailed reply! I will try this in my container.
