Practical questions about disk partitioning, moving the /home directory and shrinking the / system directory.
Bas G. Roufs
basroufs at gmail.com
Sun Jul 14 20:41:32 UTC 2024
Hello Nils and everybody else.
Op zo 14 jul 2024 om 09:09 schreef Nils Kassube <kassube at gmx.net>:
> […]
> > My question about this: how best to do this - from GParted installed
> > WITHIN Kubuntu 24.04 OR from GParted live at a Ventoy USB stick?
>
> First of all, GPT is needed only if the drive is >2TB, so you don't need
> GPT. Therefore I would keep the current partition table because otherwise
> it would be more complicated.
At my old SSD, I have used GPT too - so, I have sticked to this.
> And you should do it from a live system because you can't manipulate
> partitions which are in use.
>
> With gparted I would remove sda3 of the new disk and then create a new
> extended partition sda3 which spans the free space of the disk.
> Next I would copy the / partition from the old disk (sdb3?) to the free
> space of the new disk using gparted - that partition would become sda5.
>
When trying to work with Gparted from the Ventoy USB, I made a mistake,
because of which I needed to reformat the whole new SSD. This was no
problem. I had backed up everything, including my recent work. And I could
also take recourse to a Foxclone image backup I still had from a few days
ago.
So, I cloned again the old SSD to the new one. Like that, I got the
following configuration - I combine info from the terminal, sudo fdisk-l,
with the info from GParted:
Partition table entries in disk order, from left to right, according to
GParted.
Device Start End Sectors Size Type
/dev/sda4 34 16383 16350 8M BIOS boot
/dev/sda1 16384 993279 976896 477M EFI System
/dev/sda2 993280 32243711 31250432 14,9G Linux swap
/dev/sda3 32243712 488396799 456153088 217,5G Linux home
/dev/sda5 488396800 2000408575 1512011776 721G Linux filesystem
SDA5 was an unallocated space after cloning the old SSD to the new one.
However, it was not possible to format it from GParted at the Ventoy USB.
Instead, I used GParted within Kubuntu 24.04 - SDA5 was not in use. I could
format it as ext4.
> If you really want to shrink the / partition you can also do it now.
>
I have dropped this idea.
At some later stage, I'll get built in an extra 512 GB mSata SSD, which I
wanna partition in two halves - one for the system partition /, another one
for a Timeshift system backup. I already know building in such an internal
mSata SSD is possible. After doing so, I'll move the system partition to
one half of the mSata SSD and use the whole 1 TB SSD for /home.
When running sudo fdisk -l in the terminal, I get this result for the 1 TB
SSD:
Disk /dev/sda: 953,87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: Patriot P220 102
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: EB958308-C538-4924-8EDC-C7A1B53DBDDE
Device Start End Sectors Size Type
/dev/sda1 16384 993279 976896 477M EFI System
/dev/sda2 993280 32243711 31250432 14,9G Linux swap
/dev/sda3 32243712 488396799 456153088 217,5G Linux home
/dev/sda4 34 16383 16350 8M BIOS boot
/dev/sda5 488396800 2000408575 1512011776 721G Linux filesystem
Partition table entries are not in disk order.
(snip)
> Now you should remove the old disk because your fstab probably uses UUID
> entries and the UUIDs of the cloned partitions are identical to the
> original ones.
>
>From this point onwards, I have followed a slightly different strategy.
I had already removed before - right the old disk after the cloning
operation. And I also had formatted the yet empty sda5 with ext4. I have
labeled the sda5 partition as «Camino-casa». Then, via Midnight Commander,
sudo mc, I have recursively copied everything from home in sda3 to -for the
time being- home-new in sda5. I copied everything including symlinks,
permissions, etc.
At some point, I'll rename home in sda3 as home-ori and home-new in sda5 as
home.
However, what exactly do I need to do at this point - in what order? And do
I need to rewrite something in the file /etc/fstab?
Thanks for considering these practical questions.
Yours,
Bas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20240714/c86575cb/attachment.html>
More information about the kubuntu-users
mailing list