14

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?

thi gg
  • 361

3 Answers3

9

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:

  1. Install Dislocker, which allows you to mount Bitlocker partitions under linux

  2. 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
    
  3. Run gparted on this device

    sudo gparted /tmp/bitlocker/dislocker-file
    
  4. You resized now the filesystem in the bitlocker partition. Resizing the partition itsself may destroy it, so proceed carefully.

  5. Get blocksize of your partition:

    sudo parted /tmp/bitlocker/dislocker-file unit s  print all
    
  6. 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.

thi gg
  • 361
0

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.

Allexj
  • 294
-1

The easiest way is to let Windows resize it:

  1. Move partitions around with GParted, and leave free space after the Windows partition encrypted with Bitlocker.
  2. Reboot in Windows, and use Windows own partition manager (diskmgmt.msc) to extend the Windows partition as much as possible.

This saves a lot of time, by avoiding the need to decrypt then reencrypt the whole Windows partition.