LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-15-2023, 06:15 AM   #1
Herve5
Member
 
Registered: Oct 2016
Location: Europe
Distribution: Debian & Ubuntu Mate
Posts: 107

Rep: Reputation: Disabled
enlarging the / partition in crowded context


Hello,
I am in trouble with an Ubuntu lapto where the / partition is now too small, but without space 'at right' to enlarge it.
The partitioning order is the following : efi, swap, / and /home. (I also have a second internal HD, with lots of space)
df -h gives the following :
~$ df -h
size user avail used on
/dev/nvme0n1p3 50G 45G 1,7G 97% /
/dev/nvme0n1p1 512M 5,0M 507M 1% /boot/efi
/dev/sda1 1,8T 1,4T 453G 75% /datadisk
/dev/nvme0n1p4 882G 201G 681G 23% /home
/home/frederique/.Private 882G 201G 681G 23% /home/frederique

I understand, maybe wrongly, that
- I cannot move or expand / without booting from elsewhere (at least this is not available in GParted)
- it would be very dangerous, and long, to try moving the enormously filled /home
- maybe it is similarly bad to touch the / itself, even though it's smaller.


Any ideas on how to proceed?
As far as I can see, the latest Ubuntu upgrade won't pass, because of the lack of space...


Thank you!
Herve
 
Old 11-15-2023, 08:12 AM   #2
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,976
Blog Entries: 33

Rep: Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467
Herve5,

What really helped me in Linux Mint was to remove older kernels, apart from the current one and its predecessor:

Update Manager > View > Linux kernels > Continue >

Select 5.15 (in my case) and then keep latest two kernels.

Remove all earlier kernels.

Now again run:

Code:
df -m /
The percentage of root partition in use should have fallen.

When you next do a fresh installation, make sure you create a larger root partition.

Last edited by beachboy2; 11-15-2023 at 08:56 AM.
 
Old 11-15-2023, 08:35 AM   #3
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554
Quote:
Originally Posted by beachboy2 View Post
Delete temporary files:

Code:
cd /tmp
sudo rm -rf *
A dangerous command (for several reasons) that is unnecessary when /tmp can be properly cleared by a simple reboot.

 
Old 11-15-2023, 05:57 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Generally speaking linux filesystems (XFS excluded) can be resized at will, and easily moved around. gparted used to permit it, but maybe they got too many problem reports they didn't want to handle.
That mount for .Private implies /home is an encfs - ugh. Everything should still be do-able from a gparted liveUSB.

Let's see the (uneditted) output from these commands - add sudo in need.
Code:
lsblk -f -e 1,7 -o +SIZE
parted /dev/nvme0n1 "print,free"
 
Old 11-15-2023, 07:46 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Does your system now use LVM = Logical Volume Management, or can you now install it? This might well get rid of your problem entirely.

Under LVM, physical space is described as "storage pools" which can span multiple partitions and volumes. Then, filesystems are allocated from "logical volumes" defined within those pools. If you run low on space, you can simply expand the storage pool, then reformat the filesystem to recognize the added space. (An operation which can be performed without downtime.)
 
Old 11-15-2023, 10:14 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by sundialsvcs View Post
Does your system now use LVM = Logical Volume Management, or can you now install it?
A quick look at the OP's "df" output shows that LVM is not in use, and an in-place conversion to LVM is one of those operations that fall in the category of, "If you have to ask how, you probably should not be attempting it." Converting by migrating the data to a new disk is fairly straightforward, and a web search will reveal several suggestions for a procedure.
 
Old 11-16-2023, 02:31 AM   #7
Herve5
Member
 
Registered: Oct 2016
Location: Europe
Distribution: Debian & Ubuntu Mate
Posts: 107

Original Poster
Rep: Reputation: Disabled
Thank you all for these very significant comments!
I discovered that it's not /tmp but /var/temp that is overloaded, with lots of 80-Mb files more than one year old.
I also understood that, contrary to the files in /tmp, those in /var/tmp are NOT cleaned at startup.
So after a lot of hesitation I issued the following command :
sudo find /var/tmp -type f -atime +300 -delete
I used type f to only address files not folders, atime 300 looks very conservative, keeping almost one year of old files.
I saved a LOT of space, and the system seems stable including after reboot.
I'll wait a bit, launching more apps before maybe cleaning further. But at this moment it seems I don't need resizing partitions anymore...
Again, thank you, you were precious!
H.
 
Old 11-16-2023, 02:38 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
You haven't given much (any) info, but a systemd based system should clean up both - using different durations. From memory 30 days for /var/tmp. Depends on how often you boot of course.
 
1 members found this post helpful.
Old 11-16-2023, 03:02 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,925

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
you can use ncdu -x / to check it. For root partition 50G is more than enough, you ought to clean/remove unnecessary things. Otherwise you need to move personal files (videos, databases, any huge files ) onto another partition.
 
1 members found this post helpful.
Old 11-16-2023, 03:47 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Have you read the thread ?. Seems the OP has been cleaning up.
 
Old 11-26-2023, 06:20 AM   #11
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,833
Blog Entries: 17

Rep: Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639
Quote:
Originally Posted by syg00 View Post
Have you read the thread ?. Seems the OP has been cleaning up.
Perhaps, but user errors also have to be ruled out...

Nonetheless it might be worth double checking.. (and mapping the issue)
Code:
du -sh /lib/modules/ /tmp/ /usr/src/ /usr/
Anyways, if he wants to resize things, it is ALWAYS adviced to make backups FIRST. It should be possible to take from /home if he unmounts it first. Possibly making a partition for /usr and rsync (or cp -aR or use tar) the old stuff from /usr /usr-new.

Last edited by zeebra; 11-27-2023 at 02:27 AM.
 
Old 11-26-2023, 03:21 PM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by zeebra View Post
One common solution to this issue in the first place is to use a separate partition for /usr.. That might sound very old fashion, ...
Very old-fashioned. For at least 10 years now, most distributions have not supported a separate /usr filesystem. Indeed, in Ubuntu the /bin directory is just a symlink to /usr/bin, so the system simply will not boot unless /usr is mounted by the initrd early in the boot sequence. It is possible to arrange that, but a mounted /usr will cause the automatic boot-time fsck to fail for that filesystem.
 
Old 11-26-2023, 03:30 PM   #13
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,141

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
Quote:
Originally Posted by sundialsvcs View Post
Does your system now use LVM = Logical Volume Management, or can you now install it? This might well get rid of your problem entirely.

Under LVM, physical space is described as "storage pools" which can span multiple partitions and volumes. Then, filesystems are allocated from "logical volumes" defined within those pools. If you run low on space, you can simply expand the storage pool, then reformat the filesystem to recognize the added space. (An operation which can be performed without downtime.)
Was going to suggest biting the bullet and reinstalling on LVM, or BTRFS (if you avoid the raid 5 / 6 stuff) as well. This allows easy volume resizing while online, at least growing them for root in this case. I switched to lvm a long time ago now and it has saved me a world of difficulty as I tend to distro hop a ton and add and dump volumes quite often. I've debated trying it on BTRFS but I'm just lazy at this point. That and I've set a goal to use a single distro instead of hopping. In this case a year without deviating installation.
 
1 members found this post helpful.
Old 11-27-2023, 02:26 AM   #14
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,833
Blog Entries: 17

Rep: Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639Reputation: 639
Quote:
Originally Posted by rknichols View Post
Very old-fashioned. For at least 10 years now, most distributions have not supported a separate /usr filesystem. Indeed, in Ubuntu the /bin directory is just a symlink to /usr/bin, so the system simply will not boot unless /usr is mounted by the initrd early in the boot sequence. It is possible to arrange that, but a mounted /usr will cause the automatic boot-time fsck to fail for that filesystem.
Ooh, that's right.. Forgot about distroes symlinking system files into /usr.. Then ofcourse you can't have seperate /usr, which means you MUST have a big root partition if you install alot of software. Not smart.

My bad.

Does Ubuntu use /usr/local? In that case, he could do it with /usr/local

Last edited by zeebra; 11-27-2023 at 02:30 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why is my /boot directory so very crowded? BigVig Linux - Newbie 8 07-11-2020 03:26 PM
Enlarging Mate panel without also enlarging the icons Changes Linux - General 3 04-04-2016 07:35 AM
Enlarging existing partition wrangler Linux - Newbie 1 03-14-2005 08:26 AM
Crowded $HOME Kocil Linux - General 8 09-22-2003 12:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration