The officially official Devuan Forum!

You are not logged in.

#1 2026-04-24 18:54:18

unixbot443
Member
Registered: 2026-03-28
Posts: 5  

Weird usb partitioning issues

I am experiencing some weird USB partitioning issues.  In gparted, my usb stick does not show the full size, and when there should be 3 partitions, only 1 is listed.  lsblk shows 3 partitions.  When I go to do a dd to write a iso (~4gb) to usb, it takes ~2s.  I've tried 2 different usb sticks now, and get the same thing.

Offline

#2 2026-04-24 19:03:01

Mercury
Member
Registered: 2024-11-14
Posts: 39  

Re: Weird usb partitioning issues

Unfortunately, I don't have any insight, but I have encountered instances where gparted was "confused" about the partitions on a drive but CLI tools (including parted!) correctly recognized the layout. I've been suspicious of it ever since.

Offline

#3 2026-04-24 19:26:53

rolfie
Member
Registered: 2017-11-25
Posts: 1,432  

Re: Weird usb partitioning issues

Defective or fake stick?

Online

#4 2026-04-24 19:29:18

unixbot443
Member
Registered: 2026-03-28
Posts: 5  

Re: Weird usb partitioning issues

Nope, they were working previously.

Offline

#5 2026-04-24 23:26:34

greenjeans
Member
Registered: 2017-04-07
Posts: 1,616  
Website

Re: Weird usb partitioning issues

Okay, in general it depends on the tool you used to create partitions. Gparted has a flaw where it can't always read a USB properly, but it's not altogther Gparted's fault all the time. There are a number of tools to create a liveUSB, and a lot will install your iso, but they take up the entire stick with one iso-9660 partition. Unless the tool that you used to create any new partitions pre-emptively wiped the free space before it created your new partitions, it will frequently leave a small signature of 5 bytes that still identifies it (at least to Gparted) as one big partition.

The gnome-disk-utility should "see" your other partitions correctly, but even if you make new ones with it Gparted still won't "see" them even if GDU and your file-manager do, because GDU doesn't pre-emptively wipe either. But it will see extra partitions even if Gparted won't.

Both gnome-related, so good luck with getting them to admit it's an issue or fix it.

Last edited by greenjeans (2026-04-24 23:27:18)


https://sourceforge.net/projects/vuu-do/ Vuu-do GNU/Linux, Devuan-based Openbox systems.
Devuan 6 mate-mini iso, pure Devuan, 100% no-vuu-do, mostly wink
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
https://devuanusers.com/

Offline

#6 2026-04-25 20:52:19

Elyon
Member
Registered: 2026-03-25
Posts: 33  

Re: Weird usb partitioning issues

Have you tried wiping all partition info on the usb?

sudo dd if=/dev/zero of=/dev/sdX bs=1M status=progress

Thinkpad x280 - Devuan Excalibur 6 - Xfce Desktop Environment - Apt/Appman

Offline

#7 2026-04-27 00:27:41

guuml.dev1
Member
Registered: 2018-12-09
Posts: 22  

Re: Weird usb partitioning issues

There is a BIG "weird" (not really;-)  distinction between USB stick and USB hard disk: The "type of storage" depends on the partition table found on the device. And "device" means for example /dev/sdb XOR /dev/sdb1.

Given you're creating a boot stick from some image with dd of=/dev/sdb if=./cool-devuan  your stick becomes a kind of CD or DVD: there is only one partition with the size of the image! On the other hand gparted /dev/sdb shows you the whole space on the device just because the found partition table is interpreted a similar way like grub will do.

There is no supposed "flaw" in gparted: GÜ has spent his last raw DVD to chimaera and has checked that DVD with several machines successfully. GÜ has copied that 1.9GB image to a 32 GB USB-Stick (your devices may differ)

dd if=./cool-devuan of=/dev/sdc

The BIOS/UEFI recognizes the Stickas  a "bootable CD" and boots successfully, BUT gparted /dev/sdc shows roughly 30GB unused spaced on the stick. And that is good! Doing a dd of=/dev/sdbc1 if=./cool-devuan and creating a filesystem on /dev/sdc2 while keeping the stick bootable is left as an exercise to the reader.


guuml is an abbrevation for gü in ASCII (1967),
focused on devuan and skipping epic poems like beowulf.
Has Gü spent his last raw DVD to a chimäre? No.

Offline

#8 2026-04-27 02:51:02

steve_v
Member
Registered: 2018-01-11
Posts: 681  

Re: Weird usb partitioning issues

The only "flaw" here is the usual confusion regarding partitions, filesystems, and the x86 boot process.
isohybrid is a hack, and writing an iso image to a USB device does not create a normal partition table - that's the whole point, to be bootable from optical media it needs to look exactly like a CD to the BIOS routines.
CDs don't have partitions or an MBR, the raw iso9660 filesystem starts at sector 17 and the space before that is an "unused" system area to be used by [insert system-specific boot hackery here] - often syslinux and/or a partition table defining an ESP for UEFI in a bootable GNU/Linux image.
Thus what you usually end up with is a disk where the partition table does not reflect reality, intentionally, the first few reserved sectors contain an el-torito CD boosector, an MBR, a GPT, syslinux, or some combination of those, and the whole mess appears to be a simple iso filesystem to anything that doesn't look too hard.

All this will confuse traditional partitioning tools, especially if the device was previously partitioned and whatever you used to write the image didn't remove the existing partition table (and backup), RAID headers, or whatever else was on there.
It's not a "flaw" in parted, iso9660 on anything but optical media was just never supposed to be a thing and the spec for what should be at the start of the disk is intentionally vague.

Ed. Also, this.

Having a bootable iso image and other filesystems on one device simultaneously is even more of a hack, and generally requires installing a (second) bootloader that can chainload an iso9660 [insert system-specific hackery here] boot record or handle loop-mounting the filesystem and locating the kernel image itself... This is why grub-imageboot and ventoy exist, and it's also why they are so complicated and unreliable.

On the OP: Make sure the device is properly clean, first with a (fast) tool like wipefs, and if that doesn't do it, nuke the entire device with a (slow) cp or dd from /dev/zero. Check the latter can write the entire expected size of the device - if it can't then what you have is likely a hardware problem.
As for "takes ~2s", you're probably just seeing write-cache. Try oflag=direct to bypass kernel caches (see dd manpage).

Last edited by steve_v (2026-04-27 03:53:25)


Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Offline

#9 2026-05-01 15:41:45

askfor
Member
Registered: 2024-12-19
Posts: 9  

Re: Weird usb partitioning issues

Have you tried cfdisk or fdisk? Do you have any other OS installed on the same machine to try partitioning tools?

Offline

#10 2026-05-01 20:05:06

Mercury
Member
Registered: 2024-11-14
Posts: 39  

Re: Weird usb partitioning issues

steve_v wrote:

It's not a "flaw" in parted, iso9660 on anything

It absolutely, objectively is a flaw when partitioning tools don't check the actual, contractual structure of a partition table including the 0x55AA signature, because they "think" they found an ISO9660 filesystem based on loosey-goosey pattern matching of non-contractual parts of the MBR. Everything in the MBR before the partition table and the two-byte signature is not and must not be used to conclusively determine disk structure. Any tool that does is doing it wrong.

Edited to add:

It's still baffling that gParted and parted behave differently, when they are supposed to be using the same underlying libparted library. As convenient as the GUI is, it's only gParted that gets it wrong, while parted (and presumably libparted) work correctly.

Last edited by Mercury (2026-05-01 20:17:36)

Offline

#11 2026-05-01 20:23:07

greenjeans
Member
Registered: 2017-04-07
Posts: 1,616  
Website

Re: Weird usb partitioning issues

Well you can say it's not a flaw or a bug or whatever, but when a tool like gparted cannot tell there are 2 partitions on a stick when every other tool and even file managers can, it's an issue, period, for the user. See Mercury's post above.

But there is also a flaw in GDU, one that would be super easy to fix really. As all that's needed is for it to call wipefs on the empty space before creating a new partition.

# Proactively wipe ISO-9660 signatures to prevent Gparted detection issues
wipefs -a -t iso9660 "$USB_DEV" 2>/dev/null || {
    error_dialog "Failed to wipe ISO-9660 signatures on $USB_DEV."
}

It's literally that easy. But GDU doesn't do it, and it leaves 5 bytes that confound gparted. So i'm sticking by what I said, they both need to be fixed.


https://sourceforge.net/projects/vuu-do/ Vuu-do GNU/Linux, Devuan-based Openbox systems.
Devuan 6 mate-mini iso, pure Devuan, 100% no-vuu-do, mostly wink
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
https://devuanusers.com/

Offline

#12 2026-05-01 23:32:28

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,653  

Re: Weird usb partitioning issues

The "problem" for partitioning tools is probably that for a hybrid ISO, the first partition spans the whole disk, from sector 0 and to the last ISO sector. That span of course includes both the partition table and the second partition.  It also has the additional quirk, that the iso9660 interpretation has a block size of 2048 bytes per block, whereas the disk image view used in particular for the second partition is of 512 bytes per block.

I guess it's not easy for a graphical tool developer team to present and manage that kind of partition overlap which barely is understandable for normal people.

Offline

#13 Yesterday 05:47:54

askfor
Member
Registered: 2024-12-19
Posts: 9  

Re: Weird usb partitioning issues

I am not sure I understood it correctly. You said that USB media worked properly previously. Previous to what ? What exactly did you do to make it work improperly ?

Also, what are you trying to do ? Are you trying to wipe off everything on the media and start fresh ? Or are you trying to write something on one of the partitions, while leaving others intact ?

Offline

#14 Yesterday 08:38:40

unixbot443
Member
Registered: 2026-03-28
Posts: 5  

Re: Weird usb partitioning issues

I just want to wipe everything, and start fresh.

Offline

#15 Yesterday 09:07:37

PedroReina
Member
From: Madrid, Spain
Registered: 2019-01-13
Posts: 298  
Website

Re: Weird usb partitioning issues

I just want to wipe everything, and start fresh.

Then, you can use dd, but you will have to be extremely cautious to not wipe out the wrong unit.
To use dd you have to write as root

dd if=/dev/zero of=/dev/YOUR-RAW-DEVICE

For instance:

dd if=/dev/zero of=/dev/sde

Please note that there are not a number in the name of the unit. This is important.
Double check your typing before ENTER!!
Wait to completion and then use sync before unplugging the stick.

Last edited by PedroReina (Today 07:27:02)

Offline

#16 Yesterday 16:12:11

chris2be8
Member
Registered: 2018-08-11
Posts: 370  

Re: Weird usb partitioning issues

I would start by running lsblk and ls -l /dev *before* plugging in the USB stick, then re-running them after plugging it in. There should be a new device which is the one to wipe. You certainly don't want to wipe something that was there before you plugged in the USB stick!.

And taking a full backup before you start would give you a bit less to worry about.

Offline

Board footer