Is there a problem with the way that Ubuntu mounts/reads flash drives?

C

CrazedNerd

Guest
Sorry if this question seems like gibberish to you, I am still a n00b in terms of general linux knowledge.

It seems like operating systems in general struggle with this, the data on the drives must be written properly to begin with for operating systems and the BIOS to be able to recognize them. I feel like this is a catch-22, and sophisticated operating systems like Ubuntu or Windows should be able to recognize/analyze the nature of flash-drive data by default whether it's corrupted, a bootable image, etc.

MAYBE there is also a problem with the way devices get mounted to the Ubuntu file system. I've struggled with an issue over the past couple days of writing a bootable Fedora image over the past couple days with dd (a command line tool for writing/erasing data). The problem can't be dd, because it's the only program i've found so far that successfully writes boot images to flash drives. In the past, i resorted to using DVD-Rs with img-burn (a free and very limited program that works with Windows) in order to get linux up and running.

The problem I've had over the past couple days, and the solution can be summed up as thus: i've tried to use dd to write a bootable image of fedora so i can add it to my hard drive, but i was getting a lot of error messages in terms of both my flash drives, and at times i was not able to use Disks (probably the best GUI paritioning tool in linux...) to fully format the flash drives. I tried to use dd to go ahead and write over everything, but unfortunately the program would just display a flashing cursor, then after a couple hours dd finished its work and said something like "/dev/sdb: unable to write", and even though it appeared to work i didn't get an image that could be read by my BIOS. According to the BIOS, this flash drive did not exist...

However, i was miraculously able to format the entire drive with as a FAT file system with Disks after this time-consuming failure, and then miraculously it took a whopping ~2 MINUTES for dd to do it's work:

Code:
xarathustra@xarathustra:~/Desktop$ sudo dd if=../Downloads/Fedora-Workstation-Live-x86_64-35-1.2.iso of=/dev/sdb1 status=progress
[sudo] password for xarathustra:
1986273792 bytes (2.0 GB, 1.8 GiB) copied, 148 s, 13.4 MB/s
3924480+0 records in
3924480+0 records out
2009333760 bytes (2.0 GB, 1.9 GiB) copied, 148.804 s, 13.5 MB/s

:oops:

........

So why exactly do I keep running into this problem with flash drives? Shouldn't writing images be relatively easy?
 
Last edited by a moderator:


ok couple of things ; you see that /dev/sdb1 your trying to write to a partition and should just be writing to the stick . Your stick would be /dev/sdb and sdb1 is a partition on it
so of should be of=/dev/sdb


I've often done DD to a stick and as long as i saw like records in etc and no errors then I never even though of bothering to look, just power down and boot up from stick , then see how it went.

Now another approach which works for some Linux distro is to use ventoy. Thats formats the stick then you just drag and drop iso files . Mint from a ventoy stick boots fine, so then you have an option of clicking on Desktop "install icon" to actually install from a running live Distro from a usb.

Now for me stick that I know works using fdisk ; this is what i get :
Code:
    Disk /dev/sdc: 14.61 GiB, 15682240512 bytes, 30629376 sectors
Disk model: Cruzer Force
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[andrew@darkstar:~]$

and it doesn't auto mount nor show me anything visually; but I know I an boot from it . I just accept the quirks. basically, DD wipes pretty much everything so nothing much remains except whats needed to get distro to boot
 
Last edited:
ok couple of things ; you see that /dev/sdb1 your trying to write to a partition and should just be writing to the stick . Your stick would be /dev/sdb and sdb1 is a partition on it
so of should be of=/dev/sdb
Part of what i'm trying to discuss here is...the drive above was already broken into two separate devs/paritions which is what caused this process to take so long...in the above story i tried to just write Fedora over the largest partition taking over most of the drive. I was having trouble figuring out how to make it all into just a single partition and the reason i don't fully understand. Is it a problem with mounting, the programs, Ubuntu, or just an inevitable part of the structure of things? There's always human error, but i can't do a whole lot about that except continue to learn:p
 
I just want to let everyone know here, that through all this experimentation, using Disks to format your flash drives with a FAT file system pretty much guarantees that the drive will be visible to your linux operating systems...even though dd is great for making [single] bootable images, it appears a lot of the command line tools have problems with recognizing flash drives that are not formatted or written in very specific ways...

EDIT: Ext4 works as well, i guess part of the problem is that you've got to reboot your OS if it becomes invisible to the terminal...
 
Last edited by a moderator:

Members online


Top