# USB Drives

### USB Ports <a href="#usb-ports" id="usb-ports"></a>

#### Antsle one, Antsle one Pro, Antsle one Ultra

![](/files/-Lzsww5KxpxXfF7z2GeU)

#### Antsle one XD, Antsle one XD Pro, Antsle one XD Ultra

&#x20;Blue usb ports: usb 3.0.\
Black usb ports: usb 2.0.<br>

![](/files/-LzswzreCnyOT0h3IsTF)

**NOTE:** You must change the boot options in the system BIOS after adding a USB device. Upon the next restart, the Antsle will try to boot from the USB and fail. If you did not [configure IPMI](https://docs.antsle.com/setup/#5-ipmi-optional) you can connect a keyboard and monitor to the Antsle. Power up and hit \<Del> at the SuperMicro splash screen to enter the bios settings. Arrow over to the 'Boot' menu and select 'USB Device BBS Priorities' and set the boot option to 'disable' for the usb device. Save settings and exit.

There are three main ways to utilize external USB drives with the Antsle.

* Add Zpool storage
* Give an antlet exclusive access to a USB drive
* Mount USB storage in the edgeLinux file system

### Create Zpool on External USB Drive <a href="#create-zpool-on-external-usb-drive" id="create-zpool-on-external-usb-drive"></a>

You can use additional external USB storage for antlets and virtual drives.

First ssh to the Antsle

```
ssh root@myantsle.local 
```

To see the existing drives run

```
lsblk
```

The drives are named: sda, sdb...

Plug in your usb drive and run 'lsblk' again to see the name of the new drive - it should be the last drive in the list.\
Now we want to prepare the drive for zfs by removing the partitions on the drive. This will destroy all data on the USB drive!

```
parted -a optimal /dev/sdX
```

where 'sdX' is the name of your usb drive

```
mklabel gpt
```

this will warn, any data on the drive will be destroyed. If this is ok with you, answer Yes.\
then quit 'parted'

```
q
```

Now lets create a zpool on the drive

```
zpool create POOL_NAME -m /POOL_NAME /dev/sdX
zfs set atime=off POOL_NAME
zfs set compression=off POOL_NAME
```

Replace POOL\_NAME with a name to identify the new zpool.\
Replace 'sdX' with the actual drive name\
POOL\_NAME must be the same in each part of the commands. ex:

```
zpool create myusbdrive -m /myusbdrive /dev/sde
zfs set atime=off myusbdrive
```

Now you can refresh antman and create a new antlet or virtual drive on this zpool. You will see the new zpool in the 'zpool' dropdown.

### Create a Mirrored Zpool for Data Protection

If you want mirrored usb disks repeat the 'parted' steps for the second drive but run the following zpool commands.

```
zpool create POOL_NAME -m /POOL_NAME mirror /dev/sdX /dev/sdY
zfs set atime=off POOL_NAME
zfs set compression=off POOL_NAME
```

sdX and sdY need to be replaced by the actual drive names displayed in 'lsblk' Replace POOL\_NAME with the desired zpool name

You do not need to update /etc/fstab. zfs will take care of mounting the zpool if the Antsle is rebooted. Refresh antMan and you should see the new zpool.

### Remove a zpool <a href="#remove-a-zpool" id="remove-a-zpool"></a>

At the Antsle's command line list the zpools

```
zpool list
```

Then destroy the zpool

```
zpool destroy POOL_NAME
```

Remove the directory the zpool was mounted to

```
rm -rf /POOL_NAME
```

Now if you refresh antman and try to create a new antlet, the zpool dropdown will no longer list the usb zpool.

### USB Pass Through <a href="#usb-pass-through" id="usb-pass-through"></a>

Note: Currently USB Pass through only works with KVM antlets

USB Passthrough allows you to assign an external USB drive to a specific antlet. \
Enter the antlet details page by clicking the name of the antlet

![](/files/-LzsxPkRP0OEAD5ut0aV)

Then choose the 'USBs' tab and select your device.

![](/files/-LzsxTutfbpcxDTEx8D2)

Be sure to 'Stop' then 'Start' the antlet.

### Mount USB in the edgeLinux file system <a href="#mount-usb-in-the-edgelinux-file-system" id="mount-usb-in-the-edgelinux-file-system"></a>

This can be useful to store installation .iso files or store backups of other files without filling up the root '/' partition. List the existing drives with the command:

```
lsblk
```

The drives are named: sda, sdb... Find your device and partition number in the list. \
Create a directory to mount the USB in

```
mkdir -p /mnt/usb1
```

Mount the USB

```
mount /dev/sdXN /mnt/usb1
```

replace 'sdXN' with the device(X) and partition number(N) with those of your USB as seen in the 'lsblk' command.

Note: For edgeLinux 0.13 or prior, if you get an NTFS unknown file system error, you can install NTFS support with the command:\
emerge sys-fs/ntfs3g

Check that you can see the files on the USB with

```
ls /mnt/usb1
```

To make this mount persist after a reboot, we need to add the mount info to the 'fstab' file.\
First lets get the UUID and file system type from the USB drive using the `blkid` command. In this example the drive name is `sdc` as found in the `lsblk` command

```
blkid |grep sdc 
```

The output will include both the UUID and file system TYPE. The output may have other info like a LABEL.

```
/dev/sdc1: UUID="42AA6C2CAA6C1F23" TYPE="ntfs" PARTUUID="c129de7b-01"
```

We can now update the `/etc/fstab` file to mount the USB when booted.\
Make a backup of `/etc/fstab`and open it for editing

```
cp /etc/fstab /etc/fstab.bak
nano /etc/fstab
```

Add the following line to the end of the file using your UUID, mount point and file system type.

```
UUID=42AA6C2CAA6C1F23  /mnt/usb1  ntfs  noatime  0 2
```

To un-mount the USB (the command is 'u'mount not 'un'mount)

```
umount /mnt/usb1
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.antsle.com/system/usb-drives.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
