Trisquel upgrade 8.0 to 9.0 - size of /

8 réponses [Dernière contribution]
anonymous

Hi all,

I am trying to upgrade my Trisquel install from 8.0 to 9.0.

However, when I run


$ sudo do-release-upgrade

the installer complains about missing space on my / partition:


Not enough free disk space


The upgrade has aborted. The upgrade needs a total of 7'461 M free
space on disk '/'. Please free at least an additional 2'186 M of disk
space on '/'. Empty your trash and remove temporary packages of
former installations using 'sudo apt-get clean'

Obviously, I did what the message says and also ran sudo apt-get clean
but unfortunately that did not help.

How do I proceed with the upgrade? Do I have to resize the / partition? If yes, how do I do so safely and without data loss?

Thanks for your help in advance.

***
ADDITIONAL INFO
***


$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.8G 0 3.8G 0% /dev
tmpfs 773M 9.6M 764M 2% /run
/dev/sda1 19G 13G 5.0G 72% /
tmpfs 3.8G 173M 3.7G 5% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/mapper/trisquel--vg-home 418G 103G 315G 25% /home
tmpfs 773M 60K 773M 1% /run/user/1000


$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 18.6G 0 part /
└─sda5 8:5 0 428.5G 0 part
└─sda5_crypt 252:0 0 428.5G 0 crypt
├─trisquel--vg-swap_1 252:1 0 11.2G 0 lvm [SWAP]
└─trisquel--vg-home 252:2 0 417.3G 0 lvm /home
sr0 11:0 1 1024M 0 rom

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

First of all, execute the following command in a terminal, if you have not already done so:
$ sudo apt autoremove
If you have never run that command, your disk may have more than 2186 MB of kernels and of other packages, (dependencies of other packages that you have removed) that would be removed. You would then be able to upgrade to Trisquel 9. It is however probable that it will not be enough (every kernel with its initrd weights ~50 MB).

If you want to avoid repartitioning, you can remove some heavy packages (such as games). After the upgrade, you may have enough space to reinstall them.

Repartitioning can be done from a live system with GParted (for a graphical interface), such as Trisquel's live system. I would approximately double the size of /dev/sda1, to be at ease, without uselessly wasting space. It is simple to do, from GParted, if your /dev/sda5 does not have an XFS filesystem. It probably has XFS though, because it is the default choice Trisquel's installer does, at least up to Trisquel 8 (I have not done a fresh install of Trisquel 9 yet). XFS does not support shrinking.

If your /dev/sda5 has an XFS filesystem ('lsblk -f' would tell you now) and if you still want to go with repartitioning, that can be done plugging an additional disk with free space where you would copy /dev/sda5. You would then delete /dev/sda5, expand /dev/sda1 and move back the partition with the user data in the (now smaller) free space on /dev/sda. You would then need to edit the information in the first column of the line with "/home" in /etc/fstab (that of the installed system, not that of the live system). That first column probably contains a UUID (because that is the default) but it can simply be "/dev/sda2", if the new smaller partition for the user data is /dev/sda2 (choose the proper number otherwise). In fact, /etc/fstab may have to be modified in that way even after redimensioning of existing partitions. I am not sure. If so, the first column of the line with "/" must be modified as well. 'lsblk -o +UUID' prints the UUIDs, if you do not want to uselessly edit /etc/fstab.

Or you can backup all the user data (do that anyway!), preferably with BackInTime (Trisquel 9's default; Déjà-Dup is not in the repository anymore!), export your list of packages from the Synaptic Package Manager as I explained in https://trisquel.info/en/wiki/cloning-system-or-how-make-copy-installed-packages-one-computer-another and do a fresh install from Trisquel 9 (choose the "Something else" type of install to dimension your partitions as you wish). After rebooting on the newly installed system, restore your backup and reinstall your packages, as explained as well behind the link I have just given. Because some packages (such as deja-dup) do not exist on Trisquel 9, there will be some warnings but, hopefully, you will be able to reinstall almost all your applications with minimum input.

If you go with repartitioning, you may want recovery entries in your bootloader (GRUB), to not have to use a live system if you end up not properly editing the line with "/home" in /etc/fstab: GRUB_DISABLE_RECOVERY must not be true in /etc/default/grub (to be edited with administrative privileges, e.g., with 'sudo pluma /etc/default/grub'; 'sudo update-grub' must be executed after any modification in /etc/default/grub). If you upgrade to Trisquel 9 and use PPAs, executing ppa-purge before the upgrade may avoid some problems.

Piriponzolo
Hors ligne
A rejoint: 02/19/2016

I have upgraded to Trisquel 9 with the command "sudo sed -i 's/flidas/etiona/' /etc/apt/sources.list && sudo apt update && sudo apt full-upgrade" and all was OK.

chaosmonk

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/07/2017

An oversimplified description of the upgrade process is:

1. Download all the new versions of packages
2. Install all the new versions of packages
3. Remove the old versions of packages (you may need to do this manually with "apt clean"

The problem I think you may be having is that your root partition is not large enough to store two versions of each package, so it runs out of disk space during step 1. After step 3, you will be back to having one version of each package, so it may not be worth it to increase the size of your root partition (and in doing so decrease the size of your home partitoin) given that you will only need the extra space during steps 1 and 2.

I ran into this problem while attempting to upgrade the software on my PocketCHIP from Debian Jessie to Debian Stretch, as the CHIP has very little disk space. What I ended up doing was,

1. Edit /etc/apt/sources.list and change "jessie" to "stretch" (or in your case change "flidas" to "etiona")
2. Run "sudo-apt-update"
3. Upgrade as many packages as I can without running out of disk space
4. Run "apt clean" to free up disk space
5. Repeat steps 3 and 4 until all packages are upgraded

This might not be completely safe, but neither is repartitioning.

Here's another option: The source of your problem is that your Trisquel installation has a separate partition for /home. I wish that this was not the default, because of the exact problem that you are running into. However, there is an advantage to having installed Trisquel this way. You can install Trisquel 9 onto your root partition while leaving your home partition untouched. In general I consider this to be to advanced a procedure to expect beginners to take advantage of, but if you want we can walk you through how to do it.

apitsch (non vérifié)

Hey everyone,

thank you for your extensive, thoughtful and helpful replies. I greatly appreciate it - this is the spirit which makes the Free Software Movement so great.

Let me evaluate my options of how to proceed. I will let you know what I've decided to do and return for your help if I need it.

Thanks a lot.

nadebula.1984
Hors ligne
A rejoint: 05/01/2018

I have read your additional information. Strangely, you have encrypted /home and swap but not /

If you encrypted / as well (so that the logical volumes for / and /home belong to the same volume group), it would be very easy to increase the space of either logical volume. Simply shrink the other and then expand the one that requires more space using lvm2.

Since your / partition is outside the encrypted volume group, it's very hard to re-partition. Here are my suggestions:

First, try to remove any unneeded packages using "sudo apt autoremove". If this step still fail to make enough room, try to remove some big packages including games (e.g. supertuxkart). You can also try to clean your /tmp and /var directories using appropriate tools.

If you decide to re-partition your disk after making a complete backup, here is what I do: Everything except /boot is encrypted. (If you use GPT partition table, you'll need EFI partition and/or BIOS Boot partition as well.) Whenever you need to increase the size of / or /home, it'll be very easy using lvm2. Theoretically you can encrypt /boot as well, but this makes booting very tricky. By leaving only /boot (and optionally EFI/BIOS Boot) partition unencrypted, attack surface has already been minimized.

apitsch (non vérifié)

Hi all,

Decision

as @nadebula1984 pointed out, my setup is not particularly sane and does not provide me with the flexibility & privacy I could have.

So, I think, I will just make a clean install of Trisquel 9.0 on my T400 and repartition the hard drive.

Process

This would be my process (please point things out to me, which you'd do differently or which I've missed):

  1. BACKUP! I'll do both Deja-Dup and BackInTime (thanks for the hint, @Magic Banana). Should I only backup /home (which is my default) or also back up packages, /etc configs and so forth? What is your take? @Magic Banana recommends to save the installed packages, but I was thinking maybe I can use this opportunity to clean up my PC a bit...
  2. Test, whether I can access the backups from another computer (better safe than sorry).
  3. Create a bootable Trisquel 9.0 USB.
  4. Boot from USB and repartition the hard drive like so:


    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 447.1G 0 disk
    ├─sda1 8:1 0 2.1G 0 part /boot
    └─sda5 8:5 0 445.0G 0 part
    └─sda5_crypt 252:0 0 445.0G 0 crypt
    ├─trisquel--vg-swap_1 252:1 0 11.2G 0 lvm [SWAP]
    ├─trisquel--vg-home 252:2 0 370.0G 0 lvm /home
    ├─trisquel--vg-root 30.0G lvm /
    └─ leave some space unused
    sr0 11:0 1 1024M 0 rom

    • Is 1.0G sufficient as a /boot partition size? Since it is outside the LUKS container again it's not gonna be easy to change that ...
    • Is my SWAP partition outsized? What is its main use and what are the advantages of it being bigger?
    • Is it worth having dedicated partitions for /var, /etc, /srv etc. on a home computer?
  5. Install Trisquel.
  6. Re-install & configure applications.

Thank you for your advice.

PS: I think in my case my full texlive install is taking up so much space on /.

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

Should I only backup /home (which is my default) or also back up packages, /etc configs and so forth? What is your take?

If you have ever modified configurations in /etc, you probably do not want to lose them. /etc is small anyway. For the list of packages, I gave you a way to save the list from the Synaptic Package Manager (there are terminal ways too). But you may be referring to actual packages, in /var/cache/apt/archives/. If you want to save some download, you may indeed move them to the /var/cache/apt/archives/ of Trisquel 9, before you reinstall your favorite applications. However, do not expect much gain: most packages for Trisquel 9 are newer than those for Trisquel 8 and, if so, the newer version will be downloaded.

Is 1.0G sufficient as a /boot partition size?

If you regularly (e.g., monthly) execute 'sudo apt autoremove', it should be enough. Again: every kernel with its initrd weights ~50 MB. That is what takes most of the space in /boot. GRUB takes 12 MB here.

Is my SWAP partition outsized? What is its main use and what are the advantages of it being bigger?

See https://trisquel.info/forum/trying-install-thinkpad-x200s#comment-129988

Is it worth having dedicated partitions for /var, /etc, /srv etc. on a home computer?

Not for a desktop system. For special needs (for instance for a database server), it may make sense to create more partitions so that different types of filesystem can be made on each of them, for performance purposes.

I think in my case my full texlive install is taking up so much space on /.

Yes, TeX Live takes much space, especially its documentation.

apitsch (non vérifié)

So, I wanted to give you on update on how I fared: All is well.

For future reference maybe:

  1. With the re-install of the OS, I had my fair share of frustration initially:
    • The original partitioning setup which caused the problems during the release upgrade is the default choice of the Trisquel graphical installer (provided one wants to encrypt the disk and use LVM)!
    • When trying to prevent having an encrypted and separated out /home partition via the manual partition setupin the graphical installer, I was not able to create volumes on the encrypted partition - so I had to switch to the text based installer.
    • Thanks to this guide I was able to achieve the setup I wanted: namely, an encrypted hard drive containing the root partition and swap as logical volumes. Beware the guide also encrypts /boot, so make sure you create a separate (unencrypted) partition for that if you don't want to have /boot encrypted.
  2. Thanks for pointing out to me in advance, that Trisquel 9's backup tool is "Back In Time". That made it very easy to restore my /home dir.

Thanks again for your help and Happy New Year to all of you!