Practical questions about disk partitioning, moving the /home directory and shrinking the / system directory.

Nils Kassube kassube at gmx.net
Sat Jul 20 08:49:38 UTC 2024


On 20.07.24 Bas G. Roufs wrote:
> Op do 18 jul. 2024 12:36 schreef Nils Kassube <kassube at gmx.net>:
> > Start Kubuntu 24.04 live system from the USB stick.
> 
> I get this idea. I understand everything you write here. I can do so. But
> one important question remains.....
> 
> > Run konsole and become root with the command
> >
> > sudo su
> >
> 
> I get this idea. But what about the superuser password when running the
> live version of Kubuntu 24.04 LTS?

There is no password in the live system. You can run all sudo commands and you won't be asked for a password.

> > so you don't need to enter sudo for many of the following commands.
> 
> Now check that sda is your 1TB SSD with
> >
> > fdisk -l /dev/sda
> >
> 
> I get this one.
> 
> 
> > and then mount the sda3 partition to /mnt with the command
> >
> > mount /dev/sda3 /mnt
> >
> 
> Good point. Did not do so yesterday in the recovery mode session.

That part isn't necessary in the recovery session because the partitions should be mounted already according to the scheme in /etc/fstab. It is necessary in the live system though because the partitions of the internal disk aren't mounted automatically with the live system.

> > Now you can check that the home folder exists
> >
> > ls /mnt
> >
> > among various others there should be a folder named home.
> 
> 
> I get it..
> 
> If it doesn't exist, create a new empty home folder:
> >
> > mkdir /mnt/home
> >
> 
> I get this too.
> 
> 
> > Now mount the sda5 partition to the home folder:
> >
> > mount /dev/sda5 /mnt/home
> >
> > then check the contents
> >
> > ls /mnt/home
> >
> > there should be a folder bas but I think you will find the home-new folder
> > here instead.
> 
> 
> Tests yesterday in the recovery mode delivered this result.
> 
> If you really find the home-new folder instead of the bas folder, move the
> > bas folder of the home-new folder upwards:
> >
> > mv /mnt/home/home-new/bas /mnt/home
> >
> 
> I know, the folder /home-new/ exist. However, not sure yet about
> /home-new/bas/.

IIRC you didn't report that you moved the bas folder in home-new, so it should still be there. But ...

> > If there is neither the folder bas nor the folder new-home, you can copy
> > the bas folder from your home-ori folder:
> >
> > cp -a /mnt/home-ori/bas /mnt/home
> >
> 
> I tend to do so anyway, because the «home-ori» folder at sda3 is more up to
> date then «home-new» at sda5.

Well, then you're right and copying is better and you can ignore the /mnt/home/home-new/bas folder. Maybe you want to remove it later when things are working to recover the disk space.

> > Finally you could check that the fstab file is the new version:
> >
> > cat /mnt/etc/fstab
> >
> 
> Also this check I still need to carry out from the Ventoy live USB?

Yes, the commands I wrote in that mail were all meant to be used in the live system. If you start from the internal disk, the fstab file would be in /etc/fstab (without the /mnt part).


Nils







More information about the kubuntu-users mailing list