Friday, April 26, 2013

NTFS drive formatted by Linux missing a drive letter in Windows.

With Windows 7 having long proven itself a stable and family-friendly OS, I decided to simplify my life, ditch Ubuntu Linux on the desktop after nearly 10 years and go back to Windows.  I had a couple of external hard drives that I'd used GParted to partition and format to NTFS for cross-platform compatibility.  Or so I thought.

I copied several gigabytes of data to one of these NTFS-formatted USB drives, blew away Ubuntu and installed Windows 7 Home Premium SP1 with all the current patches. When I reattached the USB drive, Windows recognized the hardware and it showed Online in Disk Management but a drive letter was not assigned and all options to assign one were grayed out. I could not open or access any data on the drive. A minor panic ensued.

I downloaded VMware Player and a Ubuntu LiveCD. Booted it, attached the drive and Linux could still read it. Whew! I tried to transfer the data via the network from the Linux VM to the Windows host but it gave me fits.  I needed to get the drive mounted in Windows.

Long story short, I discovered that GParted had formatted the drive as NTFS but left the partition ID as "83" which is "Linux".  This obviously confused the hell out of Windows.  I could verify this using the following Linux command:
sudo sfdisk --print-id /dev/sda 1
The output shows me the partition ID of /dev/sda1:
83
I needed to change the partition ID to "07" which is NTFS (and some relatives).  To do this, I made sure the drive was unmounted and issued the following Linux command:
sudo sfdisk --change-id /dev/sda 1 07
This changes the ID of /dev/sda1 from 83 to 07.  Output:
Done.
I disconnected the drive from the VM and....Voila! The drive now mounts successfully, drive letter and all, in Windows.

5 comments:

SConklan said...

Interesting. Always something. I am using Windows 8 now on my desktop and my Acer Tablet. Always keep up with the latest versions. Even have a Windows Phone.

james john said...

The information you have posted is very useful. The sites you have referred was good. Thanks

online assignment help
affordable assignments

Aparna said...

Nice blog...! It was very interesting and very informative info. I am regularly reading your post and I need more unique posts. Keep doing...
Power BI Training in Chennai
Power BI Training
Job Openings in Chennai
Advanced Excel Training in Chennai
Oracle DBA Training in Chennai
Corporate Training in Chennai
Primavera Training in Chennai
Social Media Marketing Courses in Chennai
Pega Training in Chennai
Power BI Training in OMR
Power BI Training in T Nagar

Madhu Balan said...

I am really enjoying reading your well-written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
PHP Training in Coimbatore
PHP Training Institute in Coimbatore
best selenium training in coimbatore
Python Classes in Coimbatore
android app development course in coimbatore
embedded systems course in coimbatore
German Language course in Coimbatore
Selenium course in coimbatore
Java Training in Bangalore

Cheap Logo Design Service in California said...

We believe a custom logo design will take each business to a whole new level. A logo doesn’t just indicate what a company is all about but is the face of what the entire brand provides. We at Logo Infinix make sure each client is satisfied receiving all the help it needs to reach higher ranks among other competing companies.