How to reformat my USB drive back to working condition?

Here is the thing. I have two USB drives. One was intended for Fedora 35 and the other is not. It is where I backed up my files.

While both were plugged into my computer, I accidently installed the ISO onto my other USB, which I will now call B. As you may have guessed by now, the other USB, which I intend to use Fedora 35 on is called A.

I currently have Fedora 35 on A while B is in unusable condition. It’s plugged in but nothing is showing up in my drives. The folder in which I am able to check where they are. This is the convenient one from the “File Explorer” and not anything like “Disk Management”.

I want B to go back to the way it used to be. I can open “Fedora Media Writer” up and click restore when it gives me the option to, but this does nothing. And I’ve done it a few times already. I can also go to “Disk Management” and try out all the options, but I still get nothing.

So I am wondering how I would be able to reformat my USB drive to working condition.

In the meantime, I will be waiting for a response.

Thanks.

Welcome to ask.:fedora:edora @overanyterrain

Could you please give us more info’s as :

inxi -Fzx in terminal and post the output as </> Preformatted text here.

Plug the two usb’s in while doing the inxi command.
So we do see how they are formatted and can give better advice.

Plugging that in gave me this:

“‘inxi’ is not recognized as an internal or external command,
operable program or batch file.”

When I checked Disk Management the Volume of B is called “(Disk 7 partition 1)” and the file system is “RAW”. It also says the status is Healthy.

A says “FEDORA-WS-L” and it says FAT32. This is also labeled as healthy.

Would you like to disconnect all USB drive and then connect it again only with B. Then run:

lsblk -f

and post it here the result. May be from there we could see what is actually your B current partition layout.

In response to the message that inxi is not installed it can easily be installed with sudo dnf install inxi. It should have offered to install it for you.

This also tells me the same thing as above.

“‘lsblk’ is not recognized as an internal or external command,
operable program or batch file.”

Doing that gave me this.

“‘sudo’ is not recognized as an internal or external command,
operable program or batch file.”

I am using the Command Prompt

Are you copy and paste it? Did you try just to type it ? Without any "" or '' before and after.

Previously I was using the CMD under Windows 10, now I am using the Terminal for F35 so maybe the results are different because of this? Also I do not remember typing “or” in. I just typed in what commands people told me to plug in.

Here is what I found after using “Inxi -Fzx”:


System:
  Kernel: 5.14.10-300.fc35.x86_64 x86_64 bits: 64 compiler: gcc
    v: 2.37-10.fc35 Desktop: GNOME 41.0 Distro: Fedora release 35 (Thirty Five)
Machine:
  Type: Desktop System: ASUS product: All Series v: N/A
    serial: <superuser required>
  Mobo: ASUSTeK model: H87I-PLUS v: Rev X.0x serial: <superuser required>
    UEFI: American Megatrends v: 1005 date: 01/06/2014
CPU:
  Info: quad core model: Intel Core i5-4590 bits: 64 type: MCP arch: Haswell
    rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
  Speed (MHz): avg: 1496 high: 1497 min/max: 800/3700 cores: 1: 1497
    2: 1496 3: 1497 4: 1496 bogomips: 26340
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: NVIDIA GM107 [GeForce GTX 750 Ti] vendor: ASUSTeK driver: nouveau
    v: kernel bus-ID: 01:00.0
  Display: wayland server: X.Org 1.21.1.2 compositor: gnome-shell driver:
    loaded: nouveau note: n/a (using device driver) - try sudo/root
    resolution: 1920x1080~60Hz
  OpenGL: renderer: NV117 v: 4.3 Mesa 21.2.3 direct render: Yes
Audio:
  Device-1: Intel 8 Series/C220 Series High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
  Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX]
    vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 01:00.1
  Sound Server-1: ALSA v: k5.14.10-300.fc35.x86_64 running: yes
  Sound Server-2: PipeWire v: 0.3.38 running: yes
Network:
  Device-1: Intel Ethernet I217-V vendor: ASUSTeK driver: e1000e v: kernel
    port: f040 bus-ID: 00:19.0
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: NetGear A6200 802.11a/b/g/n/ac Wireless Adapter [Broadcom
  BCM43526]
    type: USB driver: N/A bus-ID: 3-12:5
Drives:
  Local Storage: total: 419.24 GiB used: 7.03 GiB (1.7%)
  ID-1: /dev/sda vendor: Hitachi model: HTS545032B9A300 size: 298.09 GiB
  ID-2: /dev/sdb vendor: SanDisk model: SDSSDP128G size: 117.38 GiB
  ID-3: /dev/sdc type: USB model: Rocketfish Rocketfish size: 3.77 GiB
Partition:
  ID-1: / size: 48.33 GiB used: 5.08 GiB (10.5%) fs: btrfs dev: /dev/sda5
  ID-2: /boot/efi size: 511 MiB used: 13.8 MiB (2.7%) fs: vfat
    dev: /dev/sda3
Swap:
  ID-1: swap-1 type: zram size: 7.69 GiB used: 0 KiB (0.0%) dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nouveau temp: 40.0 C
  Fan Speeds (RPM): N/A gpu: nouveau fan: 1080
Info:
  Processes: 394 Uptime: 10m Memory: 7.69 GiB used: 2.16 GiB (28.0%)
  Init: systemd runlevel: 5 Compilers: gcc: 11.2.1 Packages: N/A
  note: see --pkg Shell: Bash v: 5.1.8 inxi: 3.3.12
[overanyerrain@fedora ~]$ inxi -Fzx
System:
  Kernel: 5.14.10-300.fc35.x86_64 x86_64 bits: 64 compiler: gcc
    v: 2.37-10.fc35 Desktop: GNOME 41.0 Distro: Fedora release 35 (Thirty Five)
Machine:
  Type: Desktop System: ASUS product: All Series v: N/A
    serial: <superuser required>
  Mobo: ASUSTeK model: H87I-PLUS v: Rev X.0x serial: <superuser required>
    UEFI: American Megatrends v: 1005 date: 01/06/2014
CPU:
  Info: quad core model: Intel Core i5-4590 bits: 64 type: MCP arch: Haswell
    rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
  Speed (MHz): avg: 1339 high: 1846 min/max: 800/3700 cores: 1: 1846
    2: 1432 3: 1186 4: 895 bogomips: 26340
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: NVIDIA GM107 [GeForce GTX 750 Ti] vendor: ASUSTeK driver: nouveau
    v: kernel bus-ID: 01:00.0
  Display: wayland server: X.Org 1.21.1.2 compositor: gnome-shell driver:
    loaded: nouveau note: n/a (using device driver) - try sudo/root
    resolution: 1920x1080~60Hz
  OpenGL: renderer: NV117 v: 4.3 Mesa 21.2.3 direct render: Yes
Audio:
  Device-1: Intel 8 Series/C220 Series High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
  Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX]
    vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 01:00.1
  Sound Server-1: ALSA v: k5.14.10-300.fc35.x86_64 running: yes
  Sound Server-2: PipeWire v: 0.3.38 running: yes
Network:
  Device-1: Intel Ethernet I217-V vendor: ASUSTeK driver: e1000e v: kernel
    port: f040 bus-ID: 00:19.0
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: NetGear A6200 802.11a/b/g/n/ac Wireless Adapter [Broadcom
  BCM43526]
    type: USB driver: N/A bus-ID: 3-12:5
Drives:
  Local Storage: total: 448.15 GiB used: 7.02 GiB (1.6%)
  ID-1: /dev/sda vendor: Hitachi model: HTS545032B9A300 size: 298.09 GiB
  ID-2: /dev/sdb vendor: SanDisk model: SDSSDP128G size: 117.38 GiB
  ID-3: /dev/sdc type: USB model: Rocketfish Rocketfish size: 3.77 GiB
  ID-4: /dev/sdd type: USB model: USB DISK 3.0 size: 28.91 GiB
Partition:
  ID-1: / size: 48.33 GiB used: 5.07 GiB (10.5%) fs: btrfs dev: /dev/sda5
  ID-2: /boot/efi size: 511 MiB used: 13.8 MiB (2.7%) fs: vfat
    dev: /dev/sda3
Swap:
  ID-1: swap-1 type: zram size: 7.69 GiB used: 0 KiB (0.0%) dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nouveau temp: 40.0 C
  Fan Speeds (RPM): N/A gpu: nouveau fan: 1110
Info:
  Processes: 397 Uptime: 11m Memory: 7.69 GiB used: 2.16 GiB (28.1%)
  Init: systemd runlevel: 5 Compilers: gcc: 11.2.1 Packages: N/A
  note: see --pkg Shell: Bash v: 5.1.8 inxi: 3.3.12

Linux commands not work in Windows.

I had no idea, thanks for that

About your problem of the pen-drive. If you feel more comfortable with windows just format it in Windows as exfat. After it should open again in Linux.

I hope this works for you.

A couple things I note there on the inxi output.

  1. you are still on the 5.14.10 kernel which tells me the system has never been updated since it was installed (or that you are booted to the live iso USB device and not from an installed system). The current kernel version for :fedora: is 5.16.9. As long as you are connected to the internet the command sudo dnf upgrade should do a full update of everything currently installed. The update will only work for an installed system and not on a live iso.
  2. You have an nvidia GPU and are using the default ‘nouveau’ driver. That is fine as long as the graphics capabilities meet your needs. If you decide you would like better graphics performance you might want to install the nvidia driver from rpmfusion. People here will gladly assist in how to do that if you ask.
  3. A pen drive that has been used for installation as you say that one was will need to be repartitioned before you can do anything else with it. If you make 100% certain it is the only usb drive connected and that you know which one it is you can easily do that. The list above from inxi shows
Drives:
  Local Storage: total: 448.15 GiB used: 7.02 GiB (1.6%)
  ID-1: /dev/sda vendor: Hitachi model: HTS545032B9A300 size: 298.09 GiB
  ID-2: /dev/sdb vendor: SanDisk model: SDSSDP128G size: 117.38 GiB
  ID-3: /dev/sdc type: USB model: Rocketfish Rocketfish size: 3.77 GiB
  ID-4: /dev/sdd type: USB model: USB DISK 3.0 size: 28.91 GiB

I do not know which of those is the pen drive you are asking about (it could be either /dev/sdc or /dev/sdd) , so I will give an example and if you follow the pattern I give it should be ok.

  1. first do either inxi -D or use lsblk to see what devices the system recognizes. The output will be different for those 2 commands so you might want to use both to verify you know exactly which device is the pen drive.
$ inxi -D
Drives:
  Local Storage: total: 1.82 TiB used: 300.9 GiB (16.1%)
  ID-1: /dev/sda vendor: Seagate model: ST2000DM001-1ER164 size: 1.82 TiB
  ID-2: /dev/sdb type: USB vendor: Memorex model: TD Classic 003C size: 1.92 GiB


$ lsblk
NAME                   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda                      8:0    0  1.8T  0 disk 
├─sda1                   8:1    0  260M  0 part /boot/efi
├─sda2                   8:2    0  128M  0 part 
├─sda3                   8:3    0  300G  0 part 
├─sda4                   8:4    0 1000M  0 part 
├─sda5                   8:5    0   30G  0 part 
├─sda6                   8:6    0  500M  0 part 
├─sda7                   8:7    0  1.5T  0 part 
│ ├─fedora_raptor-root 253:0    0   50G  0 lvm  /
│ ├─fedora_raptor-home 253:2    0  500G  0 lvm  /home
│ └─fedora_raptor-var  253:3    0   50G  0 lvm  /var
└─sda8                   8:8    0  952M  0 part /boot
sdb                      8:16   1  1.9G  0 disk 
├─sdb1                   8:17   1  1.9G  0 part /run/media/user/Fedora-WS-Live-34-1-2
├─sdb2                   8:18   1  9.9M  0 part 
└─sdb3                   8:19   1 20.9M  0 part 
sr0                     11:0    1 1024M  0 rom  
zram0                  252:0    0    8G  0 disk [SWAP]

You can see the differences here on my system that has one hard drive and one pen drive attached. My pen drive is /dev/sdb and contains a live image of Fedora 34 Workstation as you can see by the mount point for the first partition on that device.

  1. Unmount any mounted partitions on the device you will be working with. sudo umount /dev/sdb1
  2. Now it is time to fix the partitions. sudo fdisk /dev/sdb then within fdisk you will see the following and can use the menus to manage things as you choose.
# sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The device contains 'iso9660' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.

Command (m for help): 

As it tells you “m” is used to get a help menu. The first thing you will want is to bring up that menu and you will see at the bottom an option to create a new label where you can select “o” to wipe the iso9660 label and create a dos partition table. You would then want to create a new partition with “n” and accept the defaults to recover the entire device as a single partition. Once that is done the partition type may need to be changed so windows will be able to see it by using “t” to set the type and entering “0c” for a fat32 partition. The last step which should be done only if you are certain you are working with the proper device and that things are configured as you planned is to enter a “w” to write the new partition data to the device. At any time the prompt is displayed a “q” will exit from fdisk without writing.

  1. Now you need to format a file system on the new partition you just created and in fedora it would be best done with sudo mkfs.vfat /dev/sdb1

Once the 4 steps above are completed you should have the pen drive back to its original size and usable on either windows or linux. Unplug it then plug it back in and it should automatically mount for you.

1 Like

So I ran into a problem here. While working on the help menu. Any help?

Command (m for help): o
Created a new DOS disklabel with disk identifier 0x08a6d63d.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-60628991, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60628991, default 60628991): t
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60628991, default 60628991): t
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60628991, default 60628991): T
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-60628991, default 60628991):

Well, yes. That line asked for the “last sector” and prompted for the default. It was not a command prompt.

You should have pressed enter to accept the default then after getting back to the “Command (m for help):” prompt use the “t” command.

So I just wanted to verify with you if it was okay to reset everything and start over again.

Have you tried with gnome disks(disks) app.
And open that app try select your pendrive and see how it is looking you can show us a screenshot and also you can delete all Partition of your usb drive and create a new partition of your usb drive with your like filesystem fat32 or exfat.

Here is a screenshot of the USB drive that I would like to fix.

Please note that I am currently waiting for a response from computersavvy right now and I am unsure of what the following step is.

If you can point me in the right direction that would be great. I currently have the USB unmounted and I have the terminal open with some code in it. I suspect it would be okay to reset everything as I read before that everything is preserved in memory until the final confirmation, but still I want to be careful and not fry my USB.

Okey what are the issues you have seems like your usb is okey. But if you are unsure.
Just tap on the red - button from the right side and ok it will delete that fat partition of that drive doing that will destroy your any files which maybe stored in the drive.
And then it will be a Unformated space and then just tap the + and format it with fat32 or exfat then seebif your problem solves or not.
#while formating if you want to use exfat on the format volume pop up select other and then next and then you will find exfat.

Tried this and it worked!

Thanks!