Preparing Windows disk for Linux installation

Usually it’s to be done under Linux setup shell console (open command shell from installation environment) or it may be conducted via setup-GUI (not supposed in present topic).

Resize NTFS filesystem: ntfsresize /dev/<Windows partition (e.g. sda1)> -s <NEW SIZE (e.g. 128G)>

Recreate Windows partition: fdisk /dev/<disk to process (e.g. sda)>

Then, step by step:

  1. p – check the Windows partition to resize (look HPFS/NTFS/exFAT partition with boot mark (*)), note Name and Start value
  2. d – delete partition, number is the index after disk name (e.g. sda1 – partition number is 1)
  3. n – new partition with the same first sector (Start) and the size as of resized filesystem (e.g. +128G)
  4. t – change the partition type from default Linux to HPFS/NTFS/exFat – hex code 7
  5. n – new swap partition for temporary storage of RAM content if needed (2xRAM size)
  6. t – change the partition type from default Linux to Linux swap / Solaris – hex code 82
  7. n – new partition for Linux (pick the favorite size or use the rest of unallocated space)
  8. p – shows new partitions layout, double check if it’s all right
  9. w – write out the changes

OK, get back to Linux installation and pick the Linux partition as root (/) and Linux swap as swap one mounting points.

BTW: In the case of Ubuntu LTS Server installation the mounting of swap partition leads to installer crash. Just miss the swap mounting then and add it later after system installation complete.

This entry was posted in linux. Bookmark the permalink.