Could I possibly trick windows in to thinking it's a flash drive? I dual boot, this would be really nice to have.
-
1ALTERNATIVE SOLUTION for answers below: If you want to share files between both OS, formatting a separate partition as FAT will work. FAT doesnt recieve hiberfiles from windows. So, you can enable sharing files with read/write for both OS with the a FAT partition. You can always use NTFS as read-only storage in your linux. – ashuvssut Feb 08 '23 at 20:49
-
The solution I settled on eventually was formatting the drive as exFAT, especially since Windows 10+ does a pseudo-hibernation instead of shutting down all the way. – Aido Feb 09 '23 at 20:48
2 Answers
@DrMoishe Pippik's answer was almost there, but there was a few things he missed.
To unmount the partition (so you can write to it from another operating system), you must use mountvol.exe's /P tag. This tag Removes the volume mount point from the specified directory, dismounts the volume, and makes the volume not mountable. In @DrMoishe Pippik's answer /D only Removes the mount point from the specified directory, and is why after using his commands, the partition I wanted to unmount was still locked by Windows.
Second of all, you want mountvol.exe to run to completion before hibernation is triggered. To do this we use START /WAIT.
Lastly, to unmount a partition, you must have Administrator permissions. You can do this, but creating a shortcut of the batch file below, and tick Advanced > Run as administrator on the Shortcut panel.
So, this is what the hibernate script should look like:
START /WAIT mountvol.exe <DRIVE LETTER> /P
shutdown /h
For hybrid shutdown, you may use:
START /WAIT mountvol.exe <DRIVE LETTER> /P
shutdown -hybrid -f -t 00
In Windows 8 you can access this from your Start Menu by placing this shortcut in your C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs directory, or globally, C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs.
To remount the drive after you have come out of hibernation, you will need a Mount shortcut as well. This will look like:
mountvol <DRIVE LETTER> <VOLUME ID>
To find the volume ID of your partition, type mountvol into cmd. This shows a list of the partitions in your computer. If you have already unmounted the drive you are wanting to re-mount, it may say *** NOT MOUNTABLE UNTIL A VOLUME MOUNT POINT IS CREATED *** underneath it (as shown below).
- 1,649
- 10
- 22
-
1That's a pretty nice answer! I ended up formatting it to exFAT, which I can access from Ubuntu or Windows, and Windows doesn't giver it hiberfiles. – Aido May 20 '16 at 19:11
You could make Windows un-mount a mount point and then hibernate with a simple batch script:
mountvol Path /d
shutdown /h /f /t 0
where Path is the full path to the mount point.
Once the script is created, make a shortcut to it in the Start menu (assuming you use it) and set a keyboard shortcut so that you can run it with a couple of key-presses.
See more on the mountvol and shutdown commands. Note that Windows 8 has deprecated and hidden hibernate, and you may need to enable and fix it.
- 25,661
- 4
- 36
- 54
-
2
-
See *shutdown* command-line switches. Above. /h is *hibernate*. – DrMoishe Pippik Aug 03 '15 at 19:17


