I’m trying to create a bootable 32G stick from a new drive for a Windows 10 install, but for some reason neither GParted or fdisk will allow me to use more than 4M of it. ‘fdisk F’ won’t show the other 32G. Any ideas? I can’t even figure out how to wipe it to start with a clean drive.
Here’s what happens if I just want to wipe the drive:
# dd if=/dev/zero of=/dev/sdc bs=4M iflag=nocache oflag=direct
dd: error writing ‘/dev/sdc’: No space left on device
2+0 records in
1+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.00521806 s, 804 MB/s
IOW, it’s saying it’s writing 4M, and then it runs out of room, because it’s only seeing the first 4M.
WTF?
The problem is that I’m following the instructions here. But when I look at the disk, unlike his, which is showing the whole drive, I’m seeing that 4M of unallocated space (which isn’t actually a petition, according to fdisk) at the front, and I suspect that it’s why I can’t boot from it. And I can’t get rid of it (that is, allocate it to the rest of the drive).
[Update a while later]
I’ve tried most of the things suggested in comments, but now I’ve got a new problem. I did ignore the 4M segment, and copied the Windows boot files to the 31G partition, so in theory I have a Windows boot drive. In practice, though, the BIOS on the machine I want to repair with it refuses to see it (MSI board). Moreover, I did manage to boot into Fedora, and Nautilus in Fedora saw it, even though the BIOS doesn’t. But to top it off, Fedora is becoming unusable on the machine, freezing shortly after boot, or refusing to open any programs (including a terminal), which makes it an unuseful OS.
Other than that, things are going great.
[Update a while later]
So I restored defaults on the BIOS, and now it sees the drive. Unfortunately, when I tell it to boot from it, I get “No way, Jose.”
So I still don’t seem to have successfully created a Windows boot drive.
[Monday-morning update]
I’m now starting to wonder if I have hardware issues (in addition to the thumb-drive issue). I have an SSD that looks like it might have a Windows install on it, because I can see it on my machine (the problem is with Patricia’s, which has the same type of motherboard). But when I plug in into her machine, the BIOS refuses to see it. Furthermore, sometimes (and the most recent time in which I tried to look at it on her machine), the BIOS is unresponsive, or slow. The mouse is glitchy, and there are long (as in many seconds) delays between hitting keys and anything happening. Even furthermore, I’m having the Fedora problems described above.
I hate to replace the motherboard, both because of the cost and the PITA, but if a BIOS is flaky, not sure what else to do (other than maybe trying to flash it, which could be difficult if it’s refusing to see flash drives).
[Late-morning update]
I do see at the MSI site that there have been several BIOS updates since I bought the board, so maybe I should try that.
[Late-afternoon update]
Well, now I’m royally screwed. I’ve lost another computer, and am down to a single laptop.
Fedora had been going into a mode after I removed a flash drive from Nautilus of refusing to accept keystrokes, and there was nothing I could do to get it back except to reboot. I had successfully flashed the BIOS on Patricia’s machine, and decided to update my own. But when I tried it, unlike on Patricia’s machine, the flash wizard couldn’t see the update on the flash drive, so I had to abort. It still goes into the BIOS, and will boot Fedora, but now the login screen won’t accept keystrokes, so I can’t, you know, log in.
I know that there’s nothing wrong with the keyboard, because I’m using it right now, on the laptop.
[Tuesday-morning update]
So the keyboard works in the BIOS, and when it goes into grub, I can use the down arrows to select which kernel to boot. The problem arises when it boots into a login screen. I can select the user with the mouse, but when it comes up with the password box, it accepts no input from the keyboard. And it does this with more than one boot drive, so it’s not an installation issue. Something is happening during boot that makes it stop listening to the keyboard. I’d look at dmesg but, you know, no keyboard to ask to look at it.
I’m typing this from Patricia’s computer, which I booted from a Linux drive that I usually use on the laptop. The problem here is that it runs like molasses in an Arctic January, with long periods of non-responsiveness from any software I run, though over time this morning it’s gotten better. When I look at the system monitor, there is no process that’s using a lot of resources, so it’s a mystery why the machine is so slow.
[Bumped]
OK, a little progress. If I select rescue mode in grub, I keep the keyboard. I looked through the journal and saw lots of issues but none of them obviously related to this and apparently it’s something that doesn’t happen in rescue mode. I did modify fstab so that I can boot a different computer with it (normally, it mounts a separate drive to /home, so I can keep my data off the system drive). So I’m going to reboot this machine with it and see what happens.
[Afternoon update]
Bad news, and good news.
The bad news (at least in theory, if not practice) is that the Fedora drive from my machine won’t boot in her machine, despite the same motherboard, processor, etc. It just circles and never gets to a login screen. The reason it’s only bad in theory is that I had no plans to use it with her machine–it’s just concerning that I’m getting different behavior from the two machines.
The good news is that my machine has started to pay attention to the keyboard again, and I’m doing this update from it. Perhaps the process of going into the rescue mode straightened out whatever the issue was, but at least it’s functional again.
Now to try once again to build a Windows boot drive. I’m going to use a 60G SSD that has an old Fedora boot on it, which I won’t be using, so it’s safe to just wipe it clean and see if I can make it happen this time.
[Wednesday-morning update]
I had more keyboard issues yesterday, but I think I’ve resolved it. The keyboard and the USB port that I was using for the USB stick were sharing the same port on the motherboard, and it was probably causing a conflict. I moved the keyboard to a hub on a different port, and so far, so good. Now back to trying to create a Windows drive.
[Bumped]
Well dd to zero the disk isn’t part of the linked instructions but that aside it looks to me that it was somehow partitioned with a single 4M partition. You should be able to use the Gnome disk utility to delete the existing partition and create a new one that is the entire size of the disk. The CLI way to do that is with Gparted but you should be able to do it with the Gnome utility.
I’ll see if I can take a look on my Ubuntu VM at work and double check this advice. I probably won’t get too deep into this until I’m at work tomorrow. I have a free 256 GB USB stick to play with there.
Neither Gnome Disk or Gparted will do it.
You have another blank USB stick to try?
What is the make of your USB stick?
Not really. It’s a PNY, right out of the package.
I’m trying again, this time following the instructions to the letter (on my first attempt I used dd to copy the iso to the drive) by copying the files to it instead, and hoping that it will work this time, despite the weird 4M at the beginning of the drive.
ChatGPT suggests checking to make sure the device isn’t marked read-only: Why this would be true out of the box I have no idea but you can try it:
lsblk -o name,ro
sudo hdparm -r0 /dev/sdX (replace X with your USB device identifier)
The other suggestion is to reformat. Presumably using the existing partition to see if you can remove it afterwards. This doesn’t make a lot of sense unless the disk firmware is having trouble. Anyway either way you’ve got nothing to lose. You could have a dud drive.
I’ve had a dud drive that was labeled as 128Gb, and it looked to the OS like a 128 Gb drive, but it would actually only store 16 Gb, iirc. Cheap, fake piece of garbage. Oh well, it was a Xmas present. Wouldn’t expect this sort of thing with PNY and at 32 Gb.
4MB unallocated at the front shouldn’t matter, AFAIK. Use the other space – which is apparently partitioned and allocated already?
You didn’t mention any other partitions. If so good luck. Might work.
You might try loading Ventoy onto the thumb drive. After that, merely copying the Win10 ISO onto the thumb drive will cause the live CD to show up on the Ventoy boot menu. Works with Linux bootable live CDS and I believe also Win drives (I’ve done it with a bootable Win based utility disk). I’m guessing that Rufus isn’t an option from a Win bootable machine.
When you look at the usb drive from gparted, what does it show? Have you tried “disks” as well?
Well this is a bummer. Because I’m running Ubuntu as a VM under a Win10 box at work, I can’t run Gnome ‘Disk’ as it doesn’t see anything mounted remotely through the VM (via /media) including the USB sticks.
I guess this makes sense. Unfortunately for you Rand, I need the dual of my setup here at work. At the moment, at home I don’t have any machines set-up with native Linux. A situation I need to remedy.
That’s odd. I’ve been able to get a Win10 VM running in VBox with an Ubuntu host to see thumb drives and external usb drives, but I have to explicitly tell the host VBox that I’m attaching that particular drive to the Win10 machine. Haven’t tried it with a Win10 host running Ubuntu in a VM. This might be an issue with missing guest additions.
I just verified that it is possible for a VM to see a thumb drive, but there’s a trick. With my Ubuntu host, I had to unmount the drive, but leave it plugged in. I could then check the box for the thumb drive as a device in the VBox controls. At that point, the Win10 VM saw the drive. I suspect that the trick with a Win10 host would be to “eject” the thumb drive, but leave it plugged in. Then tell the machine controlling the Ubuntu guest that you are connecting the drive to the client.
Ah. Our messages crossed.
You are correct! The VM mounts them when they are already mounted on the the host side. If I eject on the host, leave connected then on the VM (mount point has disappeared ‘natch) then go to the root window menu and select the proper USB device driver, it now shows up under ‘disk’ as 257GB exFAT on /dev/sdb1.
Again this is the dual of I need to help Rand.
FWIW I was able to delete and recreate a partition on the USB stick using ‘disk’. But for whatever reason it wouldn’t let me create an exFAT partition after selecting ‘other’ (Ubuntu-22.04-LTS).
I had to next install the exFAT driver using:
% sudo apt install exfat-fuse
Then all went well.
This is a Samsung 256GB USB thumb drive.
Some clarifications:
1) The linked directions say to install both exfat-fuse and exfat-utils. But on Ubuntu 22.04-LTS it will not install exfat-utils, instead complaining the package may be obsolete, etc. No matter, just installing exfat-fuse was good enough.
2) I misnamed the Gnome utility. It is called “Disks” not “disk”. You can search for it after clicking the “Show Applications” button in the task bar in Gnome and pin it to the taskbar for future ease of reference.
3) It is not necessary to eject on the host. Just connect under Linux VM via root window menu: Devices->USB. Once connected it will automatically dismount from host and mount on guest. Once disconnected it will dismount on guest and automatically mount back on host. This is handy if you don’t want to have to physically remove & re-insert the device on a Win10 host.
4) Shared Folders (what I have been using) is the way to share a USB stick between host and guest, allowing both to have the device ‘mounted’ simultaneously and shared. But Disks will not see a shared folder as a drive.
There is a lot to unpack here.
1) On Patricia’s machine is that a Windows host? The flash wizard I presume is a Window’s App? Or is it something you boot? You didn’t say it broke her machine so I assume all is well with her (luckily) 🙂
2) If it’s a Windows App, how did you run it on your machine which is a Linux host? Do you use Windows as a VM? Or is there a “native” flash wizard for Fedora, or, as mentioned above, is this flash wizard something you boot?
3) Can you update Fedora? Or if necessary re-install?
Yes, Patricia’s machine was a Windows host until I broke it, but the flash wizard is in the MSI BIOS. It worked fine on her machine (her BIOS was being very flaky, with glitchy mouse and long delays after hitting keys, and it had never been updated, and the update seemed to clean that up). It went so well that I decided to update mine as well. Silly me.
Worst case is that I’ll reinstall Fedora with the latest version on the M.2 on the board, but I’m concerned about why the BIOS didn’t see the update file on the root of my flash drive from my machine while it could still see folders, when it did from hers, and they’re the exact same motherboard. And what whether the failed update is why the keyboard signal isn’t being received, though that had been an issue before I tried the update, but never on login. And it had only started doing that in the last couple days, in the midst of switching so many USBs in and out.
but I’m concerned about why the BIOS didn’t see the update file on the root of my flash drive from my machine while it could still see folders, when it did from hers, and they’re the exact same motherboard.
Yes that is a concern. Perhaps her BIOS previously was at a different rev than yours?
See if MSI has anything to say about that. Or about keyboard flakyness. With luck maybe your Fedora install is still ok.
No, they were the same. Both bought about the same time, and never updated.
Root causing it through ChatGPT suggests these things in ascending order of difficulty:
1) Try a different USB port for the keyboard.
2) Update your BIOS (you tried, but should try again)
3) Check your power supply is delivering the correct voltages.
You should be able to re-flash your BIOS. If it helped Patricia’s machine it should definitely help yours. Good luck.
The fact that your keyboard issues seem related to heavy USB use though makes me suspect a hardware issue perhaps.
If your mouse seemed ok and it is USB, try plugging the keyboard into its port and see if Fedora is happy with that.
You should be able to use the Tab key to get into the login box w/o a mouse. Or just plug the mouse into the keyboard usb slot and cross your fingers.
Stupid USB tricks.
Check to see if your MSI motherboard supports more than 1 USB controller and see if you can switch your keyboard to a port on the other controller. It’s possible perhaps when you were doing heavy USB use a device got plugged in backwards on a port and caused trouble?
The fact that you are having BIOS upgrade issues on this machine using a USB flash stick that worked on Patricia’s is a bad sign.
Good luck.
They keyboard works fine in the BIOS; I can move around with the arrow keys. When I get into grub, I can select a kernel. It’s only when I get to the login screen and try to put in a password that it quits accepting keyboard input.
Doesn’t explain why you can’t flash the BIOS however.
I can’t flash the BIOS because, while it sees the flash drive, it only sees the folders on it, and not the file that it needs in the root of the drive. The other machine saw it; this one does not (even though it’s still there when looking at it in Nautilus). Bizarre.
That’s worth a call to MSI to straighten out.
…..aaand I’ll bet you are trying to update the BIOS from a USB flash stick am I right? Yikes.
What other way would there be to do it?
4) Boot Fedora into single-user mode to do a recovery (should allow your keyboard to work again) and see if that brings you back to normal. I’d focus on the fsck’s and then the dnf checks mentioned below.
Here’s what ChatGPT has to say about that.
This looks prettier on their webpage.
Q: How do I repair a Fedora install from the command line?
A: Repairing a Fedora installation from the command line can involve several steps, depending on the nature of the problem you’re facing. Here are some common scenarios and their respective solutions:
### 1. Boot into Rescue Mode
If your system is not booting properly, you may need to boot into rescue mode.
1. **Reboot your system**.
2. **Access the GRUB menu**: When the GRUB menu appears, select the Fedora entry and press `e` to edit it.
3. **Add rescue mode**:
– Find the line starting with `linux` or `linux16`.
– Append `rescue` at the end of this line.
– Press `Ctrl` + `x` or `F10` to boot into rescue mode.
Alternatively, you can use a Fedora Live CD or USB to boot into a live environment and select the “Troubleshooting” option, then choose “Rescue a Fedora system”.
### 2. Check and Repair Filesystems
Once in rescue mode or a live environment, check and repair the filesystems:
1. **List the available partitions**:
“`sh
lsblk
“`
2. **Run filesystem checks**:
“`sh
sudo fsck -f /dev/sdXn
“`
Replace `/dev/sdXn` with the appropriate device name (e.g., `/dev/sda1`).
### 3. Reinstall the Bootloader
If the bootloader is corrupted, you can reinstall GRUB:
1. **Mount the root filesystem**:
“`sh
sudo mount /dev/sdXn /mnt
“`
Replace `/dev/sdXn` with your root partition.
2. **Mount the boot filesystem (if separate)**:
“`sh
sudo mount /dev/sdXn /mnt/boot
“`
3. **Mount the necessary filesystems**:
“`sh
sudo mount –bind /dev /mnt/dev
sudo mount –bind /proc /mnt/proc
sudo mount –bind /sys /mnt/sys
sudo chroot /mnt
“`
4. **Reinstall GRUB**:
“`sh
grub2-install /dev/sdX
grub2-mkconfig -o /boot/grub2/grub.cfg
“`
Replace `/dev/sdX` with the device where GRUB should be installed, typically `/dev/sda`.
### 4. Repair Package Issues
If the issue is with corrupted or missing packages, you can use `dnf` to repair the installation:
1. **Update the package list and reinstall missing or corrupted packages**:
“`sh
sudo dnf check-update
sudo dnf upgrade –refresh
sudo dnf distro-sync
“`
2. **Reinstall specific packages**:
If you know which packages are problematic, you can reinstall them:
“`sh
sudo dnf reinstall
“`
### 5. Restore Configuration Files
If configuration files are corrupted or missing, you may need to restore them from backups or recreate default configurations.
### 6. Reset the Root Password
If you’re locked out of the system because of a forgotten root password, you can reset it:
1. **Boot into single user mode** (as described above).
2. **Remount the root filesystem as read/write**:
“`sh
mount -o remount,rw /
“`
3. **Reset the root password**:
“`sh
passwd
“`
4. **Reboot the system**:
“`sh
reboot
“`
### 7. Reinstall Fedora
If the system is severely damaged and cannot be repaired, you might need to back up your data and perform a clean installation of Fedora.
By following these steps, you can address a variety of common issues that might prevent Fedora from functioning correctly. Adjust the steps based on the specific nature of the problem you’re encountering.
Your real problem is that you are using Fedora 😀
Another thing to try is booting into a Boot Repair live CD. It’s saved my bacon a couple of times.
https://sourceforge.net/projects/boot-repair-cd/
If it does turn out to be the USB ports on your motherboard, in the future if you plan on doing a lot of duplication of USB sticks or whatever reason you are doing heavy USB use on your machine, an investment in a cheap USB 3.0 hub splitter to electrically isolate your USB controller could save you costly replacements down the road.
So I as a user of Ubuntu I can’t speak for Fedora, but ChatGPT suggests you may have a boot option in Grub that might be causing trouble.
It also suggests you can use the ‘on-screen keyboard’ to use your mouse to input characters to the login screen. This is an option that’s supposedly available from the accessibility settings on the login screen.
Ubuntu has the same feature. I can login from a lock screen with the mouse using the ‘on-screen keyboard’ switch obtained under Ubuntu’s accessibility options (icon in lower right corner, brings up a people icon in the upper right that when you click on it gives you a bunch of options, ‘on-screen keyboard is one of those’) and everything still works post login. I noticed that if I play around with some of the other ‘accessibility settings’ it will definitely screw up the keyboard in the same fashion you are seeing.
I remember awhile back you said you were having trouble with Wayland vs Xorg. You might want to make sure that somehow you didn’t pop back into Wayland. That’s also changeable via the login screen IIRC.
I’m thinking maybe a Grub option got zapped?
Now to try once again to build a Windows boot drive. I’m going to use a 60G SSD that has an old Fedora boot on it, which I won’t be using, so it’s safe to just wipe it clean and see if I can make it happen this time.
“Rots of Ruck, Rand!” – Astro
This may be unrelated, but the initial problems with the USB drive reminded me of a problem I had; my desktop system could not access some of my USB drives, but could others (that worked fine on my laptop).
Looking at the partition gave me similar results to what Rand had; not seeing most of the drive.
Turned out, my desktop (which has a mix of USB 2.0 and 1.0 ports, due to having a lot of USB ports) wasn’t happy with those drives in USB 1.0, but they worked fine in 2.0.
Another problem with USB that is surprisingly common is that dust easily gets into the contact pad area, making a connection impossible. Cleaning that out every few months is a good idea,
This is one of the most aggravating hobbies I have seen someone enjoy.
Ever try Origami? Or Golf?
Yup, and my own hobbies include doing things that other people wouldn’t find enjoyable.
I like to fix things too, even if it costs more, because it feels good. But there is always a time vs money vs reward trade off taking place. Whatever time Rand has spent dealing with this could have earned him enough to buy several computers, but that isn’t as satisfying. The more struggle the more dopamine, right?
The more struggle the more dopamine, right?
dopamine: noun a catecholamine neurotransmitter in the central nervous system, retina, and sympathetic ganglia, acting within the brain to help regulate movement and emotion.
Etiology: the word is a conjunction of the words “dope” meaning drug, idiot or fun activity (sl) and “ami” the French word for friend.
🙂