Re partition a hard disk with out losing the partions and date already on the disk

Questions about hardware, drivers and peripherals.
In the Original Post please also include the output of inxi -Fzx
User avatar
xendistar
Posts: 443
Joined: 08 Jun 2014 08:17
Location: Bournemouth, UK

Re partition a hard disk with out losing the partions and date already on the disk

Postby xendistar » 25 Jul 2017 18:57

I have a 500gb disk which currently has the following partitions

sda1 - EFI
sda2 - Extended
sda3 - swap
sda4 - /home
sda5 - / in the extended partition (58gb)

I have 134gb unallocated in the extended partition
I have 61gb unallocated on the disk

What I would like to do is move /home from sda4 to the 61gb of unallocated on the disk then delete the extended partition. Once that is done I will expand move the the partitions on the disk a tad (I have a NAS to store all my photos, music and videos).

I have done this along time ago but I cant find the how to I used, I know I have to do the move via a live CD and then manually edit the fstab file to reflect the new layout. Can anybody point me in the right direction on how to do this please.

User avatar
ilu
Posts: 2060
Joined: 09 Oct 2013 12:45

Re: Re partition a hard disk with out losing the partions and date already on the disk

Postby ilu » 25 Jul 2017 22:36

Boot from live DVD, create a partition in that unallocated space with gparted and copy /home into it. If you create the right size of partition (you can always resize later) you can use dd for copying and thus get an exact copy. Edit fstab and replace blkid of old home partition with blkid of new home partition. Reboot.

That should do it - or did I miss anything? I'm tired ...


Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest