1

My drive partitions are:

sudo parted --list
Model: ATA ST2000LM003 HN-M (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system  Flags
 3      1049kB  215GB   215GB   primary   ext4
 1      215GB   1834GB  1619GB  extended               lba
 7      215GB   430GB   215GB   logical   ext4
 5      430GB   1215GB  785GB   logical   ntfs
 6      1215GB  1834GB  619GB   logical   ntfs
 2      1834GB  2000GB  167GB   primary   ntfs         boot

GUI partition map of same drive made with gnome-disks

  1. the partition 3 is used for /home/ folder of my Linux.
  2. The Partition 1 is contained three partition which it have:

    • Partition 7 as Mounted at Filesystem Root Partition 5 and 6 as
      Mounted at /media/root/ACAC8B5FAC8B23461 and Mounted at /media/root/EAD8A297D8A262151 which have my important personal
      data like projects and ...
  3. Portion 2 is NTFS — Not Mounted and i don't use it and don't know why configured with this big size?

As you can see, I have 167 GB free in Partition 2 (/dev/sda2) and it is not mounted (NTFS — Not Mounted). Can I combine it by my Linux portion /dev/sda3 and what consideration must be taken because main Linux partition is Ext4 type and free partition is NTFS?

Also this is one part of installing Ubuntu instead of Linux Mint LMDE 3 Cindy.

K7AAY
  • 17,705
Soheil Paper
  • 1,429

2 Answers2

1

Moving the edges of partitions can have potentially destructive consequences for data stored on that partition. Have viable backups.

It is easier to move the ending edge of a partition outward than it is to move the beginning edge of the partition, so it would be easier if you were attempting to expand a lower number partition into space formerly held by a higher number partition (given the usual order of partition creation).

Finally, when you expand a partition you expand that partition into unformatted empty space. Thus you would be required to remove the NTFS partition to make that space available for expansion by the EXT partition.

These are likely the most important considerations. With this being said and granting the caveats outlined above, the answer to your question is yes you can expand one partition to take-up the space formerly held by a neighboring partition. (Though given all of this you may discover a different course will prove better for your specific situation.)

JamesIsIn
  • 309
0

Please make a backup before making any changes, then verify the backup matches the source files; then, make another backup to different media (disk or cloud) and verify that before making any partition changes.

You have three major (Primary or Extended) partitions: 3, 1, and 2. NTFS Partition 2 looks like it booted Windows, and you specified you want to give up running Windows on this PC.

You can't take space from Partition 2 and give it to 3 because 1 is in the way. Partition 1 also hosts the Extended partitions 7, 5, and 6, which further complicates matters.

Number  Start   End     Size    Type      File system  Flags   Use

 3     1049kB   215GB   215GB  primary    ext4                 /home

 1      215GB  1834GB  1619GB  extended                lba  
  7     215GB   430GB   215GB   logical   ext4                 /
  5     430GB  1215GB   785GB   logical   ntfs                 data
  6    1215GB  1834GB   619GB   logical   ntfs                 data

 2     1834GB  2000GB   167GB  primary    ntfs         boot    unwanted

When you install your new Ubuntu, use Partition 3 as your root, and do not create (yet) a separate /home.

 3      1049kB   215GB  215GB   primary    ext4                 /

 1       215GB  1834GB  1619GB  extended               lba  
  7      215GB   430GB   215GB   logical   ext4                 /
  5      430GB  1215GB   785GB   logical   ntfs                 data
  6     1215GB  1834GB   619GB   logical   ntfs                 data  

 2      1834GB  2000GB   167GB  primary    ntfs        boot     unwanted  

After Ubuntu installation completes, delete partition 2 then add its space to partition 1. You will now have a partition layout like this:

 3     1049kB   215GB   215GB  primary     ext4                 /

 1       215GB  2000GB  1785GB  extended               lba  
  7      215GB   430GB   215GB   logical   ext4                 /
  5      430GB  1215GB   785GB   logical   ntfs                 data
  6     1215GB  1834GB   619GB   logical   ntfs                 data  
  x     1834GB  2000GB   167GB   unassigned

Create a new ext4 partition where the unassigned space 'x' is; should be partition number 8.

Exit from the drive partitioning software and reboot. Mount partition 8. Copy the contents of ~/ into the new ext4 partition 8. Shutdown, and re-boot with your LiveUSB, and return to partitioning.

Next, delete partition 7.

Move the location of partition 5 up to where partition 7 started.

Move the location of partition 6 to the end of partition 5.

Assign the remaining unused space at the end of partition 5 to the ext4 partition 8, where you copied your ~/ which results in a simpler layout:

 3     1049kB   215GB   215GB  primary    ext4                 /

 1      215GB  2000GB  1785GB  extended               lba  
  5     215GB   990GB   785GB   logical   ntfs                 data
  6     990GB  1609GB   619GB   logical   ntfs                 data
  8    1609GB  2000GB   391GB   logical   ext4                 to be /home

If you have unused space in partitions 5 and 6, you can reduce their size when you make the changes. If you don't believe you will use 215 GB for root, you can reduce its size as well, and move the starting point of the Extended partition (#1) up as well.

Lastly, make partition 8 your /home directory, take ownership of the directories and their files in the root of partition 8, and move them into your new ~/ for your new user created when you installed Ubuntu.

K7AAY
  • 17,705