LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Mistakenly filled up 100% of /dev/root, can no longer start xsession as non-root user (https://www.linuxquestions.org/questions/slackware-14/mistakenly-filled-up-100-of-dev-root-can-no-longer-start-xsession-as-non-root-user-4175678672/)

burning 07-13-2020 09:10 PM

Mistakenly filled up 100% of /dev/root, can no longer start xsession as non-root user
 
I was installing packages from SBo when it said that I ran out of space halfway through. Running df, it said that 100% of my /dev/root has been used up. So i tried removing some of the packages I just installed but apparently that didn't bring it down by even 1% which is strange.

For some reason, I can start an x session as root but whenever I try to startx as a non-root user, it says it doesn't have enough space to make a log file;

Code:

usr/bin/startx: line 188: cannot create temp file for here-document: No space left on device
usr/bin/startx: line 205: cannot create temp file for here-document: No space left on device
usr/bin/startx: line 205: cannot create temp file for here-document: No space left on device

then later down the screen it reports:
Code:

The XKEYBOARD keymap compiler (xkbcomp) reports"
> Internal error:  Could not resolve keysym XF86FullScreen
> Error:          Cannot close "/tmp/server-0.xkm" properly  enough space?)
>                  Output file "/tmp/server-0.xkm" removed
Errors from xkbcomp are not fatal to the X server
XKB: Failed to compile keymap
Keyboard intitialization failed. This could be a missing or incorrect setup of xkeyboard (EE)
Fatal server error:
(EE) Failed to activate virtual core keyboard: 2(EE)
(EE)


upnort 07-13-2020 09:25 PM

Boot to console (init 3). Log in. Purge /tmp.

bassmadrigal 07-13-2020 11:24 PM

You can check what space is being used by the following command. Then you can go into each folder that is large and check those folders too.

Code:

sudo du -hxd 1 / | sort -h
du is to show your disk usage. -h make the output human readable (using KB, MB, GB, etc). -x will keep it within the same partition (if you have other partitions mounted, it won't go into those). -d 1 will only show the folders within the directory you're specifying. The sort -h will sort things top to bottom using human readable formats.

If you look at my example, you can see that /var/, /usr/, and /tmp/ use a lot of space. /usr/ is pretty normal to take a lot of space, but /var/ and /tmp/ are usually filled with things that can be removed to clear up space. My /tmp/ has a TON of directories, so var is easier to look at. You can use these commands to narrow down and find what is taking up your space and potentially remove it.

Code:

jbhansen@craven-moorhead:~$ sudo du -hxd 1 / | sort -h
4.0K    /srv
12K    /share
16K    /lost+found
44K    /mnt
64K    /media
13M    /bin
21M    /lib64
23M    /sbin
77M    /etc
308M    /boot
3.5G    /opt
4.6G    /lib
7.0G    /root
31G    /var
67G    /usr
120G    /tmp
232G    /
jbhansen@craven-moorhead:~$ sudo du -hxd 1 /var | sort -h
4.0K    /var/data
4.0K    /var/empty
16K    /var/netatalk
16K    /var/state
24K    /var/lock
24K    /var/named
32K    /var/yp
40K    /var/db
44K    /var/man
212K    /var/run
3.3M    /var/spool
12M    /var/www
432M    /var/tmp
796M    /var/log
3.0G    /var/lib
6.7G    /var/cache
20G    /var/slapt-get
31G    /var

Many people have /tmp/SBo taking up a lot of space. I'd start with removing that.

burning 07-14-2020 05:13 AM

Quote:

Originally Posted by bassmadrigal (Post 6145117)
You can check what space is being used by the following command. Then you can go into each folder that is large and check those folders too.

Many people have /tmp/SBo taking up a lot of space. I'd start with removing that.

Looks like /tmp was the main cause of the problem, purging it brought it straight down to 84%.

Output of df:
Code:

Filesystem    1K-blocks    Used Available Use% Mounted on
/dev/root      20511356 16258148  3188248  84% /
devtmpfs        1540744        0  1540744  0% /dev
tmpfs              32768    1200    31568  4% /run
tmpfs            1541280    28032  1513248  2% /dev/shm
cgroup_root        8192        0      8192  0% /sys/fs/cgroup
/dev/sda1        487652    46094    411862  11% /boot
/dev/sda6      103081248 42650972  55171012  44% /home
none              102400        0    102400  0% /run/user/0
none              102400        4    102396  1% /run/user/1000

output of du -hxd 1 | sort -h :
Code:

4.0K  ./srv
16K  ./lost+found
20K  ./tmp
44K  ./mnt
64K  ./media
15M  ./bin
29M  ./sbin
35M  ./etc
77M  ./opt
89M  ./root
893M  ./lib
1.9G  ./var
13G  ./usr
16G  .

Output of du -hxd 1 /var | sort -h :
Code:

4.0K        /var/empty
12K        /var/kerberos
16K        /var/netatalk
20K        /var/state
24K        /var/named
32K        /var/lock
32K        /var/yp
36K        /var/db
48K        /var/man
232K        /var/spool
11M        /var/www
50M        /var/log
175M        /var/tmp
349M        /var/lib
1.3G        /var/cache
1.9G        /var

Output of du -hxd 1 /usr | sort -h :
Code:

4.0K        /usr/X11R6
12K        /usr/i586-slackware-linux
140K        /usr/local
1.8M        /usr/games
20M        /usr/info
68M        /usr/sbin
102M        /usr/man
390M        /usr/libexec
526M        /usr/include
1016M        /usr/bin
1.1G        /usr/src
1.4G        /usr/doc
4.1G        /usr/lib
4.1G        /usr/share
13G        /usr

Thanks, I think it was just /var taking up space. I thought I could have as much disk space as I do for /dev/root, I figured all the software I downloaded would've been in my home partition but I set up the partition scheme before I realized how the LFS works.
How can I increase my root partition size while decreasing my home partition by a few Gb each so I can have more room for future packages?

kgha 07-14-2020 05:40 AM

Quote:

Originally Posted by burning (Post 6145221)
How can I increase my root partition size while decreasing my home partition by a few Gb each so I can have more room for future packages?

As I wrote in your other thread, GParted will do that for you. Shrink your /home partition, move swap partition and resize / so that it fills the available space created. You will get a warning that resizing the boot partition may break your install, but in practice it should work out fine, I've done this more than once without any issues (I suspect shrinking the boot partition can be more risky).

burning 07-14-2020 04:17 PM

Quote:

Originally Posted by kgha (Post 6145224)
As I wrote in your other thread, GParted will do that for you. Shrink your /home partition, move swap partition and resize / so that it fills the available space created. You will get a warning that resizing the boot partition may break your install, but in practice it should work out fine, I've done this more than once without any issues (I suspect shrinking the boot partition can be more risky).

Thanks! Though would I even need to mess with my boot partition? /dev/sda1 is my boot. sda5 is my root. If I shrink sda6 and resize sda5, I don't see how that'd effect sda1, my boot partition? Or does that have to do with moving my swap partition? Actually, what's the reasoning behind moving the swap partition (sda2) at all?

bassmadrigal 07-14-2020 06:36 PM

Quote:

Originally Posted by burning (Post 6145456)
Thanks! Though would I even need to mess with my boot partition? /dev/sda1 is my boot. sda5 is my root. If I shrink sda6 and resize sda5, I don't see how that'd effect sda1, my boot partition? Or does that have to do with moving my swap partition? Actually, what's the reasoning behind moving the swap partition (sda2) at all?

Many people have /boot/ on their root partition. If it is a separate partition and you're not touching it, you'll likely not even see that warning.

burning 07-15-2020 01:56 PM

Quote:

Originally Posted by bassmadrigal (Post 6145475)
Many people have /boot/ on their root partition. If it is a separate partition and you're not touching it, you'll likely not even see that warning.

Thanks.

IIRC the reason I made a separate boot partition was because I plan to at some point in future dual boot, adding a 2nd OS to my computer.

enorbet 07-15-2020 02:09 PM

Quote:

Originally Posted by burning (Post 6145789)
Thanks.

IIRC the reason I made a separate boot partition was because I plan to at some point in future dual boot, adding a 2nd OS to my computer.

It is possible to multi-boot even with "/boot" on the "/" (root) partition but UEFI type booting does require a separate "/boot" partition linked via "/etc/fstab" as you have it so it's by no means a bad idea to get used to it now.

Didier Spaier 07-15-2020 03:19 PM

Quote:

Originally Posted by enorbet (Post 6145792)
It is possible to multi-boot even with "/boot" on the "/" (root) partition but UEFI type booting does require a separate "/boot" partition linked via "/etc/fstab" as you have it so it's by no means a bad idea to get used to it now.

UEFI needs a separate partition of type EFI, not a separate /boot partition. In Slackware the EFI partition is mounted on /boot/efi but this is just a choice and /boot can be just a directory of the root partition, not a partition by itself. Actually the EFI partition needs to be mounted only when writing a file in it like an OS loader, and then it could be mounted manually on /mnt when needed, and not be listed in "/etc/fstab".

burning 07-15-2020 03:31 PM

One thing I don't understand though; How come I could login as a root user and start an Xsession then? How come it only didn't have enough memory when trying to start an Xsession as a non-root user? Do root sessions not keep logs or something?


All times are GMT -5. The time now is 05:52 PM.