0

I had one SSD disk(500GB) in my desktop. I used dual booting system(Arch Linux, Windows) and Windows used 100GB of the disk. Today I added new SSD disk to my desktop so I moved windows to new disk. Now I want to use 100GB space that windows was running in linux. How can I extend my linux partition 400GB to 500GB without using VFS or RAID? I found solution using GParted but my desktop has only external graphic card(NVIDIA 1660TI) so GParted's visualtearing is too much. So I can't do anything with that.

parted -l

Model: ATA Samsung SSD 860 (scsi) 
Disk /dev/sda: 500GB 
Sector size (logical/physical): 512B/512B 
Partition Table: gpt 
Disk Flags: 

Number Start  End   Size  File system Name Flags 
1      1049kB 538MB 537MB fat32            boot, esp 
2      538MB  430GB 429GB ext4
  • depends on your partition layout, output of parted -l? – frostschutz Feb 23 at 14:14
  • output of parted -l is this Model: ATA Samsung SSD 860 (scsi) Disk /dev/sda: 500GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 538MB 537MB fat32 boot, esp 2 538MB 430GB 429GB ext4 – Pol4b Feb 23 at 15:15
  • What do you mean by not using VFS? Do you mean LVM? – ILMostro_7 Mar 1 at 4:07
0

As this answer on askubuntu.com mentions, there's a higher risk of data corruption when you have to move the beginning of the [second] partition.

Everything in a partition is identified relative to the start point of the partition. Thus, moving the start of a partition will most likely involve modifying more data in the partition than moving the end point of a partition. The more data you modify, the greater the risk of an error creeping in because of a bug, an I/O error, a power failure, etc.

You should be able to do it with a livecd/liveusb distro and gparted just fine. It might give you a warning that there's a risk of failure or data corruption. Either way, make sure you have a backup of all of the files.


Since you say you can't use gparted, you can use parted on the commandline. Take a look at the parted move command.

parted move 2 538M 429G

EDIT:

However, your parted -l output seems to show that your first and second partitions come right one after the other already. So, perhaps all that's needed is to extend the second partition to the end of the disk.

resizepart 2 538M -1s

That will resize partition 2 to the last sector of the disk.
If you're doing it from the commandline:

parted -s /dev/sda -- resizepart 2 538M -1s

Note the double hyphen. According to the manual, that's there "to prevent -1s last-sector indicator from being interpreted as an invalid command-line option.".

Then, follow up with resizing the filesystem using resize2fs.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.