Merging two linux partitions

Robert Heller heller at deepsoft.com
Tue May 14 13:22:49 UTC 2019


At Tue, 14 May 2019 11:51:41 +1000 "Ubuntu user technical support,  not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:

> 
> I'm asking for advice so that I don't create additional problems for myself.
> 
> I've cloned my 120GB SSD to a 1TB SSD and now I want to extend the Linux 
> partition so that it uses all of the extra space of the drive.
> 
> I have formatted (using gparted) the remaining 800GB to ext4 so now I 
> have three partitions Windows, Linux and the new partition. So, the 
> question is how do I merge the Linux partition with the new partition 
> without losing any data?

1) delete the (new empty) 800GB partition (note down its end). You did not 
need to make it.
2) edit the existing linux partition so its end is what the 800GB partition 
was.  Be careful to leave the start exactly as it is.
3) You now have a 120G file system sitting at the beginning of a 920GB 
partition.
4) You may need to reboot to get the partition info updated in the kernel.
5) Use resize2fs to resize the partition

> 
> The easiest solution would be to delete my Linux partition and create a 
> new larger / partition and then reinstall. That would be a lot of effort 
> even though I have a backup of my home directory.
> 
> One other question. Towards the end of the Clonezilla options was a 
> question asking whether to copy 400 odd bytes to the first sector of the 
> new drive. I selected yes, but now a reboot brings up a menu with two 
> options. Selecting either does not reboot the computer. Shutting down 
> and restarting works as usual.
> 

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                                        




More information about the ubuntu-users mailing list