1

When I plugged in my “old” flash drive to my Windows desktop, it seemed that Windows 10 was unable to read the data on that USB stick. I checked W10's disk management and the drive's filesystem is “RAW”, therefore, I am unable to proceed with formatting the drive on Windows or any other operation with it, so I thought I'd try to fix it with my Linux server (Currently running Ubuntu 20.04 LTS) but I was still unable to recover it.

Here are some of the commands I run to try to fix it:

fdisk -l output (drive in case only):

Disk /dev/sdb: 14.46 GiB, 15512174592 bytes, 30297216 sectors!
Disk model: DataTraveler 2.0!
Units: sectors of 1 * 512 = 512 bytes!
Sector size (logical/physical): 512 bytes / 512 bytes!
I/O size (minimum/optimal): 512 bytes / 512 bytes!

mkfs.ntfs /dev/sdb output:

/dev/sdb is entire device, not just one partition.!
Refusing to make a filesystem here!!

I've tried other filesystems such as ext4 and fat, but neither of those worked. The data on that flash drive is not important whatsoever, so I'm fine with erasing all its data, if it solves this issue.

dr_
  • 28,763
  • 21
  • 89
  • 133
juoum
  • 11
  • 1
  • 3
    Considering ntfs support on Linux I don't think you can make an ntfs on an entire disk (**sdb**). I would advise to first create a partition (at least one) that Linux would see as **sdb1** THEN replay with mkfs on sdb1 – MC68020 Jun 20 '22 at 08:55
  • Thank you @MC68020, I'll give this a try! – juoum Jun 20 '22 at 09:35
  • You can analyze the problem with the flash drive according to [this link](https://askubuntu.com/questions/144852/cant-format-my-usb-drive-i-have-already-tried-with-mkdosfs-and-gparted/933035#933035), and if you are lucky, find a solution. (There are a few things to try, but it is also possible that the flash drive is damaged beyond repair.) – sudodus Jun 20 '22 at 09:58

1 Answers1

2

You need to create (at least) one partition on the disk before formatting it.

fdisk /dev/sdb

and then type:

  • n (create a new partition)
  • p (set as primary partition)
  • [Enter], [Enter] (define start and end sectors, accept default)
  • t (choose partition type)
  • 7 (set NTFS partition type)
  • p (print partitions, to see the changes)
  • w (write partition to disk)

Then you can create a NTFS fileystem on the newly created partition:

mkfs.ntfs /dev/sdb1

EDIT: As per your comment, it looks like the flash disk is corrupted. You can try to examine it via the f3 tools (as said in this answer) but the best thing to do would be to throw away the disk and buy another.

dr_
  • 28,763
  • 21
  • 89
  • 133
  • I followed your steps carefully but it didn't seem to work. Not that your answer is wrong, as I've already created loads of partitions before and these are the correct steps to achieve it, but I am getting `/dev/sdb: close device failed: Input/output error` when I attempt to write it, – juoum Jun 20 '22 at 09:38
  • Then the disk might be defective, or in read-only mode. – dr_ Jun 20 '22 at 09:43
  • 1
    It's most definitely defective. Thank you for helping out, though! – juoum Jun 20 '22 at 10:02