Today I was trying to figure out how to install NixOS live usb with a writeable filesystem (
dd-ing the iso results in read-only iso9660 fs).
I split my usb into two partitions, one empty and one formatted to ext4. I ran something like
dd if=(nixos image).iso of=/dev/sdb1. Then I realized that it probably won't work so I opened gparted to delete everything and try something else.
This is where I noticed that something strange is happening: gparted said that my 32GB pendrive has only about 1,4GB (size of first partition). It seems that
/dev/sdb is the same thing as
My windows machine doesn't see the pendrive at all.
I also have tried
How can I bring my pendrive back to usable state?
The problem is gone after restarting (now i'm embarrassed that I didn't try this earlier). I can't find a way to reproduce it. One thing I forgot to mention is that I've also mounted the iso as a loop device but I later unmounted it. As you can see on the
gnome-disks screenshot a loop device was still there, but I'm not sure if it was pointing to the iso or to the first partition on pendrive. So perhaps the loop mount somehow interfered with accessing
Just to clarify, I have tried zeroing the entire drive as well as just the first megabyte. This didn't work because
/dev/sdb was not pointing to what it should(at least that's my interpretation).