0

I have two USB external hard drives that are formatted as FAT32. They are both recognized and mounted correctly under Linux. However, one of them (/dev/sdb/) is not recognized under Windows 7 or 10. When I plug it in, Windows asks to format it. The other one (/dev/sdc/) is recognized and mounted correctly under Windows.

This is the output of fdisk -l:

Disk /dev/sdb: 465.78 GiB, 500107861504 bytes, 976773167 sectors
Disk model: M3              
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xbfc594d1

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 976773119 976771072 465.8G  b W95 FAT32


Disk /dev/sdc: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: 5000AAKB Externa
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8f9c798a

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc1        2048 976773119 976771072 465.8G  b W95 FAT32

As far as I can tell, there is no difference between them, apart from the model and the age of the disk, which should not matter. It may be that they were formatted with different software (I honestly don't remember, at least one of them was formatted with gparted), but the partition table is dos in both cases and the filesystem is also the same.
I'd like to know why this is happening, and if there is a fix. Is there a problem between Windows and FAT32?

EDIT: output of file -s:

/dev/sdb1: DOS/MBR boot sector

/dev/sdc1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 64, reserved sectors 64, Media descriptor 0xf8, sectors/track 63, heads 255, hidden sectors 2048, sectors 976771072 (volumes > 32 MB), FAT (32 bit), sectors/FAT 119232, reserved 0x1, serial number 0x31284d40, label: ""
6
  • Do you use the same USB enclosure when connecting the troublesome HDD to Windows and Linux? Commented Nov 10, 2019 at 18:12
  • No, each disk has its own enclosure.
    – point618
    Commented Nov 10, 2019 at 18:20
  • Incoherent comment. "No, the troublesome disk changed enclosures" or "yes, the troublesome disk kept its enclosure". I assume "yes". Commented Nov 10, 2019 at 18:25
  • They are both portable drives, like this: amazon.co.uk/Maxtor-500GB-portable-hard-drive/dp/B01AJWNRUI
    – point618
    Commented Nov 10, 2019 at 18:35
  • 1
    Some Linux utility might have mis-formatted the disk. Formatting it under Windows will probably solve the problem.
    – harrymc
    Commented Nov 10, 2019 at 20:56

2 Answers 2

0

Reformatting the disk (with mkfs.fat) seems to have solved the issue.

0

This is what worked for me. It involves possibly destructive steps which can damage disk and filesystem. I waive all liability if you follow this procedure.

My disk is 32GB USB, partitioned using fdisk /dev/sdb, created one logical partition that spans all the disk of the type 0b WIN95 OSR2 FAT32, formatted using mkfs.vfat. It worked under Linux but not Windows nor Mac.

I managed to fix it but I don't know what was the reason because I did not backup properly.

Before experimenting I have done backup of the disk in Linux first.

I shall have done the following so that I could restore MBR or tell you what was wrong with the filesystem:

mkdir backup
dd if=/dev/sdb of=mbr bs=1 count=512
dd if=/dev/sdb1 of=sdb1start bs=1 count=512

possible recovery is

possibly destructive command make sure /dev/sdb is a disk you want to overwrite

dd if=mbr of=/dev/sdb bs=1 count=512 conv=notrunc
dd if=sdb1start of=/dev/sdb1 bs=1 count=512 conv=notrunc

First someone pointed out that it could be multiple labels leftover so I

wipefs /dev/sdb

it has shown three items dos, gpt and iso9660. That iso9660 there was a leftover from when I copied linux image onto the disk. So I started to do something more scary

possibly destructive command

wipefs -a -t iso9660 /dev/sdb

after doing so, nothing happened. Mount on Linux but not on Windows so I continued

possibly destructive command

wipefs -a -t gpt /dev/sdb

Mount on Linux but not on Windows so I continued

possibly destructive command

wipefs -a -t dos /dev/sdb

Well now it stopped to mount on Linux and did not started on Windows :-)

Now I recreated MBR using

possibly destructive command

cfdisk /dev/sdb

using dos table and created default sized primary partition, changed it to 0b WIN95 OSR2 FAT32. Mount on Linux but not on Windows so I continued

When I changed partition type to 0f WIN95: Extended partition, LBA-mapped I finally corrupted the disk in a way that it could not be mounted in Linux anymore. Even if I mounted /dev/sdb1 using

mount -t vfat /dev/sdb1 /usb

it was not working. So I deleted the whole MBR and on up to the sdb1 boundary

possibly destructive command, I erased offset between sdb and start of sdb1

dd if=/dev/zero of=/dev/sdb bs=1 count=2048

Now I run testdisk as a last resort

possibly destructive command

After deeper and deeper scan, it found finally vfat partition. Claiming that there is corrupted FAT32 boot sector but there is OK FAT32 backup boot sector. Moreover it identified partition type as 0c WIN95 OSR2 FAT32, LBA-mapped. After recovery of the type "restore the boot sector from the FAT32 backup boot sector if it's valid (Backup BS)" from https://www.cgsecurity.org/wiki/Advanced_FAT_Repair I was again able to mount under Linux. Then I put it to the Windows machine and it is working. I still don't know why. If you feel lucky, you can investigate on your own risk what is the cause and if that is bug in Windows or Linux. I still don't know. I did not mentioned that step, but simply changing partition type in cfdisk to Win95 LBA before I destroyed sdb1 boot record did not restore Windows functionality. If it does not still work for you and have working backup FAT sector then try to destroy start of sdb1 as well using something like dd if=/dev/zero of=/dev/sdb1 bs=1 count=512 conv=notrunc before running testdisk.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .