Root partition too small - can't install software
I just installed Trisquel 11.0.1 on a 1TB harddisk. I choose LVM and let the installer decide partition sizes.
Short after the new installation, I was warned that the root partition was running out of space. It was only set to 14GB which seems to be quite low. How can I enlarge it?
I tried to do another new installation but I can't figure out how to set sizes for the partitions under LVM.
PS:
I have run update and removed older kernel not in use and deleted some other stuff (e.g. noto fonts which take up quite a lot of space). But still, I get warnings that there is too little space
By the way, there is no extra space on the harddrive, so I suppose I first have to shrink the large 'main' partition (for files) and then use til gained free space to expand the root partition.
I also forgot to mention that my drive is encrypted.
I think that the reason I use LVM is because I was let to believe that it would then be easier to resize partitions!
It usually does 23 GB and I have a much smaller hard drive.
Give this a try:
https://trisquel.info/en/wiki/how-resize-trisquels-default-encrypted-partitions
Thanks, I should have known I could find help in trisquel's wiki!
Mine is just 14 GB - I think I'll expand to 25 (if I succeed!)
Do you know why the guide uses "mydisk" and not "vda4_crypt"
when opening the encrypted device: $ sudo cryptsetup luksOpen /dev/vda4 mydisk
?
I discovered some issues regarding this and one other thing. I have send a note to Ark74, who did the last update (it seems).
> Do you know why the guide uses "mydisk" and not "vda4_crypt"
That name does not really matter, you just need to use luksClose at the end with the same name with which you used luksOpen.
If you had several encrypted volumes, using a name that includes the name of the partition on which it is (like vda4 here) would help remembering the encrypted volume of which partition it is, but if you ever had any doubt, the lsblk command would show you that easily.
Besides, when you use LVM in an encrypted volume, the names of the devices for the volume of each filesystem are entirely determined by the Volume Group name and the Logical Volume name (like /dev/mapper/vgtrisquel-root), then for any command on them, you don't need to remember the name you used in the luksOpen command.
25 GB is still sort of small especially if you use guix.
Got it
When I install Trisquel with the default installer with LVM and encryption, I usually move /home to the root volume, delete the home volume and enlarge the root volume to take the whole disk, so that everything is in a single volume and I don't need to worry about the size of the root volume ever.
As far as I am aware, the main benefit of a separate home volume is to allow reinstalling the system while keeping your data in place, but the installer can only do that if you did not use encryption. If you used encryption, the easiest to resinstall is to copy /home to another disk, make a fresh install and copy it back. For this, whether you have a separate home volume or not makes no difference.
I haven't redone this to check the commands, so it is likely that there are errors in them, but the way I would do it from a live USB would be something like this:
sudo crytpsetup luksOpen /dev/sda4 cryptlvm
sudo mount /mnt /dev/mapper/vgtrisquel-root
sudo mount /mnt/home /dev/mapper/vgtrisquel-home
sudo mkdir /mnt/home2
sudo rsync -Aax /mnt/home/ /mnt/home2
sudo umount /mnt/home
sudo mv /mnt/home2 /mnt/home
sudo lvremove vgtrisquel/home
sudo lvresize -l +100%FREE vgtrisquel/root
sudo sed -i '/home/d' /mnt/etc/fstab
sudo umount /mnt
sudo vgchange -an
$ sudo cryptsetup luksClose cryptlvm
I'll try doing it in a vm, then I could even do a script to automate this entirely.
Unlike the default installer, the netinstaller has the option of no separate home partition.
So, you would make an ordinary installation with encryption and LVM, and after that do what you described here?
Yes. Or use the netinstaller and choose encryption with LVM and then everything in the same volume.
If you make such a script, I would like to test it.
Without the cryptsetup luksOpen/luksClose commands, this should be:
sudo mount /mnt /dev/mapper/vgtrisquel-root
sudo mount /mnt/home /dev/mapper/vgtrisquel-home
sudo mkdir /mnt/home2
sudo rsync -Aax /mnt/home/ /mnt/home2
sudo umount /mnt/home
sudo rmdir /mnt/home
sudo mv /mnt/home2 /mnt/home
sudo lvremove vgtrisquel/home
This needs to be confirmed with 'y'.
sudo sed -i '/home/d' /mnt/etc/fstab
sudo umount /mnt
sudo lvresize -l+100%FREE -r vgtrisquel/root
sudo vgchange -an
This is great. I am travelling now, but when I get back, I will try it. Thanks