Read-Only USB fix

Hi, Manjaro forum,
I recently got a USB thumb drive with a weird problem. I’ve been told that it was removed from the computer while creating a bootable device (I think windows UEFI). it is read-only and named /dev/sda/.I want to format the device so it can be operable again.

here is some command and their outputs that might be helpful.
please feel free to ask for any other information.

lsblk -a
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0          7:0    0  55.6M  1 loop /var/lib/snapd/snap/core18/2679
loop1          7:1    0  49.8M  1 loop /var/lib/snapd/snap/snapd/17950
loop2          7:2    0  55.6M  1 loop /var/lib/snapd/snap/core18/2667
loop3          7:3    0     0B  0 loop 
loop4          7:4    0     0B  0 loop 
loop5          7:5    0     0B  0 loop 
loop6          7:6    0     0B  0 loop 
loop7          7:7    0     0B  0 loop 
sda            8:0    1  15.1G  1 disk 
└─sda2         8:2    1   512K  1 part 
lsblk -f                                                                                                                        INT ✘ 
NAME         FSTYPE   FSVER LABEL     UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0        squashfs 4.0                                                        0   100% /var/lib/snapd/snap/core18/2679
loop1        squashfs 4.0                                                        0   100% /var/lib/snapd/snap/snapd/17950
loop2        squashfs 4.0                                                        0   100% /var/lib/snapd/snap/core18/2667
sda       
└─sda2       vfat     FAT12 UEFI_NTFS 18E9-7989                                                                                

ls -l /dev/sda                                                                                                                  INT ✘ 
brwxrwxrwx 1 root disk 8, 0 Feb 10 19:39 /dev/sda

A USB stick needs to be partitioned, even if it will be holding only one partition. The designation /dev/sda is the whole stick — or “drive”, if you will. The partitions on it will then be named /dev/sda1, /dev/sda2, and so on.

Now, if you plan on using this as a bootable device, then the simplest way of doing it would be by way of ventoy, which is in the repositories. It will format the drive and make it bootable, and then you simply drag and drop .iso files onto it (in the second partition), and they will be bootable. Considering that it’s just a regular partition, you can also store other data in there.

1 Like

yes, I agree with you but here is the problem. I deleted the first partition in GParted.
my problem is that it’s read-only, and I can’t format the drive

Mount the partition, copy all of the data off of it, unmount it again, format it with Ventoy and put your data back.

here is the method you recommended. however, there is no log file in the directory /var/log/ventoy.log so I can’t know whats the issue.

The device has to be unmounted before using Ventoy to initialize the stick. You cannot format a mounted device.

I used it in the mounted and unmounted. it gives me the same error either way. why can’t I find the ventoy logs ?

Maybe the logging is handled by journald instead? I don’t know.

The problem is either way most likely caused either by something you did when you removed the first partition, or by a defect on the stick itself.

Have you tried creating a new partition table?

You can use sgdisk to remove all remnants of filesystems

sudo sgdisk --zap-all /dev/sdy

One of my personal projects is to improve scripting.

Over time I have created a few utility scripts