I want to shrink my windows partition, and windows does not allow to shrink more than a few GB. Can I access that bitlocker partition with GParted, parted or any other partitioning program?
2 Answers
The safe way is definitely to decrypt the partition by disabling bitlocker first. Its easy to shrink it then.
However, you can also use dislocker to shrink the encrypted partition:
Install Dislocker, which allows you to mount Bitlocker partitions under linux
Create an unencrypted device from that partition (if there is no bitlocker password set, omit it)
mkdir /tmp/bitlocker sudo dislocker /dev/<partition> -u<password> -- /tmp/bitlocker
Run gparted on this device
sudo gparted /tmp/bitlocker/dislocker-file
You resized now the filesystem in the bitlocker partition. Resizing the partition itsself may destroy it, so proceed carefully.
Get blocksize of your partition:
sudo parted /tmp/bitlocker/dislocker-file unit s print all
Run
sudo parted
:parted> unit s parted> print all # get partition number of the bitlocker partition parted> resizepart <n> <newsize + a decent amount>
Careful here: I resized my partition twice, the first time I left a couple GB, the second time I shrinked it to the actual filesystem size. While it was booting after the first time, it wasn't after the second.
-
1Since in my case, I wanted to expand it, I used parted to get enough space after it and expanded it in Windows, but your answer helped me in making the decision. Mar 23, 2021 at 7:38
-
1)You can just disable HDD cryptography in Windows settings (just search for "bitlocker" and you will find it)... but before doing that, you have to backup your hdd bitlocker partition key (search on web, for example: howto-connect.com/get-bitlocker-recovery-key-cmd-windows-10). After that you can finally restart and boot from your linux live usb, and you will be able to access and resize windows partition, so you'll be able to install your linux distro.– AllexjJan 4 at 21:15
-
2)When your linux distro will be installed, if you want to bring cryptography in windows partition back, you will have to boot windows (NOT from linux grub bootloader, BUT selecting windows via bios boot options), and then enable hdd bitlocker cryptography back. Finally restart, and when you'll try to boot windows you will be asked to write the bitlocker key, so write the key that you backupd.– AllexjJan 4 at 21:16
You can just disable HDD cryptography in Windows settings (just search for "bitlocker" and you will find it)... but before doing that, you have to backup your hdd bitlocker partition key (search on web, for example look here).
After that you can finally restart and boot from your linux live usb, and you will be able to access and resize windows partition, so you'll be able to install your linux distro.
When your linux distro will be installed, if you want to bring cryptography in windows partition back, you will have to boot windows (NOT from linux grub bootloader, BUT selecting windows via bios boot options), and then enable hdd bitlocker cryptography back.
Finally restart, and when you'll try to boot windows you will be asked to write the bitlocker key, so write the key that you backupd.
-
Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.– DavidPostill ♦Jan 4 at 21:56