How to extend file system without losing data

Hi there,
I need some support on the following:

  1. I have a 64gb sdxc with Manjaro installed on it. I use it on my laptop (I’ve other SO installed on laptop hard disk). Details at the bottom.
  2. I installed Manjaro (a while ago) I think moving from another SD using “dd”
  3. All was working fine until this evening where I lunched an update, I got a file system full
  4. I took the sdxc on my desktop and run sudo lsblk -o FSSIZE,FSUSED /dev/sdc2 getting SIZE=14.2GB USED=12.6GB.

So I understand I’ve a filesystem of 14GB on a filesystem/partition of about 60GB.

How can I extend the filesystem, without loosing its content and its “bootability”?

Thx!

Disk /dev/sdc: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Disk model: SD Card Reader  
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: D302FEDE-5DAD-4158-B920-FD9D7C58177B

Device      Start       End   Sectors  Size Type
/dev/sdc1    4096    618495    614400  300M EFI System
/dev/sdc2  618496 124728659 124110164 59.2G Linux filesystem

You can grow the file system if you have space available for it to grow into.

You can gain some space by cleaning out the package cache:
/var/cache/pacman/pkg

No.
What you just described here is
a file system of 14.2 GB
of which 12.6 GB are in use

Your fdisk output shows a ~60 GB partition on /dev/sdc2
… which is clearly not the same …

First: Make a Backup

you have to resize the filesystem to use the whole patition.
So in case of a ext4 do a

sudo resize2fs /dev/sdc2

Enlarging should tend to be relatively safe, but as always…make a backup :wink:

Thanks @Nachlese @AlexBoldt
for replying. resize2fs did the trick … and no back up :wink:
Now I’ve a few of coredumps from evince and brave.
I had to reinstall brave.
I wonder if there is a way to sort of force reinstall all installed packages. I’ll create a new entry.
Thanks again, at least now the sdxc works!

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.