How to format USB stick in qubes

Fairly new user of qubes os and learning as i go along. I have read alot on this forum plus done research privately.

I have a usb stick attached to my personal cube that i want to have my qubes backup stored on, However there is not enough space remaining on the usb to store the back up to and i want to know how i can format the usb stick from qubes.

Any help or suggestion will be appreciated.

1 Like

Attach your key on a Vm.
Find the key with df -h.
umount it like sudo umount /dev/xvdi1 (where xvdi1 is your key for example]
Then format it:
for for fat32:
sudo mkfs.vfat -F 32 /dev/xvdi1
for ntfs:
sudo mkfs.ntfs /dev/xvdi1

2 Likes

i tried the df -h in dom0 and did not saw the usb. ever since then each time i try to attach the usb to a vm i get this error. ‘‘attaching device usb_flash_disk() to personal failed. Error : QubesDaemonAccessError-Got empty response from qubesd. See journalctl in Dom0 for details.’’.

I tried removing the usb and inserting and attempt to attach to qubes and i get the same error message

1 Like

sorry I have difficulty expressing myself, df -h must be launched in the qube where your key is attach, not in dom0
For the error try to see in it:

2 Likes

Hello,

there is another way if you don’t want to use command lines

Plug your USB key into the computer and then use “qubes devices” to attach the key to the qube of your choice (personal in your example).

then open DISKS in your personal Qube

then click on your usb stick and then on the icon at the top right with the 3 dots
choose the disk format option
then according to image 2 click “format”
2

2 Likes

How do I open disks from my personal qube ?

You mean Disks app? It’s preinstalled in GNOME templates (e.g. debian-12) but it’s not preinstalled in XFCE templates (e.g. debian-12-xfce) so you need to install it there before you can use it.

@zach2mack For the record, formatting a USB stick (or 99% of tasks, for that matter) is identical on Qubes OS as it is on whatever Linux distribution your template is based on…once you are able to get the VM to be able to interact with the resource you want.

In plain English, this means that if you know how to format a USB stick on GNU/Linux, you know how to format a USB stick on Qubes OS once you can get it into the VM.

@zach2mack This error is concerning. It suggests that your sys-usb qube is malformed, of if you don’t have a sys-usb qube, you’re qubesd configs are corrupted, or misconfigured.

@Tezeria is right in that getting an empty response from qubesd when trying to attach a block device to a VM means that something somewhere isn’t doing what it should be doing.

In plain English, it means that sys-usb asked dom0 to attach your USB stick to a VM, and dom0 basically ignored it.

This is by design.

VMs are not supposed to receive a response to requests that they are not authorised by dom0 to issue, in case they are compromised (hacked) and start trying to “map” your machine internally :slight_smile:

But that defeats the whole purpose of sys-usb, if you can’t use it to pass devices through :stuck_out_tongue:

Is there any chance you could upload some of your system journal when this happened? (redact any sensitive information, of course)


If all else fails, and you feel comfortable using a terminal, you should be able to open a sys-usb terminal and issue the relevant commands to format your USB stick.