How do I disable "you need to format this disk" message in Windows Vista/7?

I've started using TrueCrypt to encrypt a partition on an external USB hard drive. I've opted for using a raw partition as opposed to a file container.

But here's the annoyance. Whenever I connect this drive to a computer running Vista or Windows 7, I get the message popup "You need to format the disk in drive J: before you can use it".

The default option is "Format disk", and I'm afraid one of these days I'll accidentally trigger it.

Is there any way to disable this message?


Solution 1:

Try to go to the Control Panel - Administrative Tools - Computer Management. In the Disk Management part, remove the drive letter for the raw partition.

It should prevent Win7 from asking you to format the partition, while letting you mount the partition in TrueCrypt.

If it doesn't work, you could try this suggestion, which is to use Autokey to automatically dismiss the messagebox when it appears.

Solution 2:

I have finally found a solution. I've tested this on Windows XP and Windows 7. With this solution device can't be accidentally formatted, when you plug it on another PC.

When you create a raw partition with TrueCrypt, it specifies it as partition type 0x06. This is a FAT partition, and Windows will always try to mount it.

Using a utility such as Beeblebrox (or your favorite RAW partition editor), change it to something else. I chose 0x64 which (based on the partition lists available) is a "PC-ARMOUR encrypted partition".

After changing it and then unplugging and replugging your device (power cycle), Windows will treat this partition as foreign and will not attempt to mount it. I will test it on Linux later, but I believe that'll prevent Linux from mounting it as well.

P.S. As Beeblebrox seems a bit outdated (last update of the Windows version in 2002) for newer Windows you can use internal diskpart. The commands for diskpart are:

list disk
select disk # <- your disk number here
list partition
select partition # <- your partition number here
set id=64
exit 

Credits are for @jonas-heidelberg and @mhenry1384.

Solution 3:

I use a program called USB Safely Remove, which knows about TrueCrypt and can be configured to automatically pop up the TrueCrypt password dialog when certain USB drives are inserted. It also allows you to unmount the TrueCrypt drive and safely remove the USB drive with a single click.

It's a commercial product (with a free trial), but they are currently giving away some free licenses, if you're quick. It's legit -- I got my license in their last giveaway.

Solution 4:

On Windows 10 with USB stick that has UEFI boot and TrueCrypt/VeraCrypt partitions nothing works.

Windows 10 assigns letters in some way that neither DiskPart nor Disk Management sees them, but registry keys are present on HKLM\SYSTEM\MountedDevices, so the “Format” message appears... also on “safely remove hardware” it appears with letters on all partitions.

Windows 10 does it so badly that the EFI partition isn't in Disk Management with the letter, and in DiskPart it is also not seen as a volume and without letter, but if you go to Explorer (use “safely remove hardware” to learn the letter but do not remove it) you see it with a letter and can enter it, modify files/folders, etc.

That keys are re-created upon re-connect, so no possible solution.

This Windows 10 is a headache... all caused by treating external media with the Removable Media Bit as 'special', one-partition devices, even while they have multiple partitions.

Example: USB EFI Boot with NTFS+EFI+... on a USB stick that is impossible to re-set the removable media bit.

Warning: Changing the partition type can corrupt data on VeraCrypt partitions.

But there is a trick touching registry... take a lot of care when doing this and quadruple-check that the hex data is identical.

On the registry key, there are two entries with same exact hex data for each partition... well, one has the letter, one starts with \??\Volume{ ...

The trick is to rename the one that starts with \??\Volume{ that belongs to the partition you want to avoid getting a letter.

Instead of starting with \??\Volume{ make it start with #{.

And of course, delete the one starting with \DosDevices\.

Then, remove it (using the “safely remove” function) and plug it again. Press F5 to refresh the key in regedit to check if it worked.

On my tests it works, but must done be with a lot of care... I insist on quad checking hex data to be the same... a lot of times I didn't quad check it, I made a mistake, and sometimes on the next reboot Windows didn't start, so I needed to fix it with an ugly bootable Windows install DVD by going into console mode and running regedit from the DVD (no need to reinstall).

So, prior to deleting anything, save that registry hive, and quad check what you do.

But ensure the HEX DATA is what you want or else you can make your system unbootable. Quad check it!!!

ADDED:

  • If you take the care to not delete (only rename) the \??\Volume{ one, and also to not edit the hex data of it, you can be safe
  • In the worst-case scenario, you to need to boot with a Windows install DVD and go to console mode, run regedit, and rename it back to start with \??\Volume{

SO:

  • Always do one at a time...better to stay on the safe side

You have been warned, it is touching the registry by hand.

Why does this work?

  • It is telling Windows to ignore that 'volume', so it doesn't assign a letter or list it in the Safely Remove Hardware list for that device.

Yes, this works for USB memory cards, sticks, etc., without needing to touch the Removable Media Bit... it is just only to hide such partitions.

Side note: This is also valid for any other partition you do not want to auto-mount on USB connect.