Announcement

Collapse
No announcement yet.

Xsession and /tmp

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Xsession and /tmp

    Hi,

    Upon trying to log in this evening I get Xsession error, cannot write to /tmp.

    I loaded up a live USB and found one partition almost full, if I go into the petitioner and resize another partition I cannot make that other partition bigger.

    Can anyone please help me?

    Many thanks in advance!

    Ross.

    Edit - I believe it's my root partition, which is 40gb, so God knows how it's become full.
    Last edited by CanyonRoss; Feb 08, 2022, 03:25 PM.

    #2

    Comment


      #3
      The photo suggests that /home is on /dev/sda6. I'll assume so below. To look into the file system when booted from the USB, you have to mount it; dolphin will mount it if you click on it there. If you have trouble finding the file system in a konsole, you can navigate to it in dolphin and press F4.

      A good first place to check is /var/log.

      Commands I find useful in a konsole:
      Code:
      ls -lhSr             # list files with human-friendly sizes, sorted by size
      sudo du -hd1   # show usage of directories, human-friendly, to a depth of 1
      (The text beginning with # are comments, you needn't type them.)

      If you run the du command at the top level, it might take a long time, and look in places it wouldn't be meaningful. I suggest running it on just a selection;
      Code:
      sudo du -hd1 etc media opt root usr boot snap var
      If you find more than a few GB in /var/log/journal, the directories under there can be deleted to get your system bootable.
      Regards, John Little

      Comment


        #4
        Thanks, I'll give this a go in a minute. You are correct that /home is on sda6. I assume /var/log should be on sda4, which is the root partition that's almost full? If that directory doesn't contain much space is there anything else I can do?

        If I go into a partitioner I cannot shrink the home partition and increase sda4 for some reason, the "free space" gets allocated after sda6 and it won't let me make sda4 larger.

        I really don't want to spend my time reinstalling the system if I can avoid it.

        Comment


          #5
          I got into the live disc and went "sudo mount /dev/sda4 /mnt"

          If I nagivate to /mnt/var/log/journal it's 1.9gb but if I go to delete it in the konsole using sudo rmdir /mnt/var/log it just says no such file or directory.

          Any thoughts? Thanks!
          Last edited by CanyonRoss; Feb 09, 2022, 09:44 AM.

          Comment


            #6
            Edit - I've no idea how but I have managed to boot into my Linux system. I have checked and my root partition only has 1.3GB free. What's the easiest/safest way to increase this space?

            Thanks so much, and please treat me like an idiot because I'm not that technically minded!

            Comment


              #7
              Yeah, I have some thoughts. DON'T do this: sudo rmdir /mnt/var/log - unless you know what you're doing. The command won't work in that way anyway because you can't remove a folder with contents. If you want to delete the journal folder AND all it's contents. this is the command:

              sudo rm -rf /var/log/journal

              Obviously this command as I wrote it assumes you are booted into your install. If you mount it from a LiveUSB like you did before, you'll need to correct the path. BE 100% sure you have typed this correctly before entering your password.

              More than 36GB for your install is rather large. Did you try the "du" commands that jlittle suggested? Personally, I'd focus on what directories might actually be full and cleanable, like this

              sudo du -sh /var /tmp /opt /snap

              Then if one looks too full like /var, follow it with this:

              sudo du -hd1 /var

              This will list the next level of folders in /var. You can continue to "drill down" into subfolders as many times as you want. You may just need to uninstall some stuff you're not using until you can make your partition larger. Once again: 37GB seems really large for an install partition. I have a way-overloaded install and I'm at 24GB.



              The reason your free space isn't allocating where you think it should is because your partitions are numbered out of order. How to fix this? Well, I'm not a windows expert so I don't know if repairing the sequence would cause windows a problem or not. My belief is it would not cause any problems.

              First lets figure out whats actually going on. In a terminal, type:

              sudo gdisk -l /dev/sda

              and post the partition output here.
              Last edited by oshunluvr; Feb 09, 2022, 12:20 PM.

              Please Read Me

              Comment


                #8
                As emphasized by oshunluvr, BE EXTREMELY CAREFUL using sudo rm -rf Do so in the wrong location and answer with Y and press Return, and you destroy your system.
                Windows no longer obstructs my view.
                Using Kubuntu Linux since March 23, 2007.
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Thanks for taking the time to reply. I'm logged in and here are some console outputs:

                  ross@ross-Alienware-15-R2:~$ sudo du -sh /var /tmp /opt /snap
                  [sudo] password for ross:
                  15G /var
                  84K /tmp
                  374M /opt
                  3.6G /snap
                  ross@ross-Alienware-15-R2:~$ sudo du -hd1 /var
                  52K /var/spool
                  2.8M /var/snap
                  4.0K /var/mail
                  4.0K /var/crash
                  4.0K /var/opt
                  4.0K /var/local
                  5.3M /var/backups
                  541M /var/log
                  52K /var/tmp
                  4.0K /var/metrics
                  13G /var/cache
                  1.8G /var/lib
                  15G /var

                  So it seems /var/cache is the main issue, then this:

                  ross@ross-Alienware-15-R2:~$ sudo du -hd1 /var/cache
                  2.6M /var/cache/snapd
                  4.0K /var/cache/samba
                  96K /var/cache/fwupd
                  28M /var/cache/app-info
                  5.5M /var/cache/debconf
                  67M /var/cache/apt-xapian-index
                  80K /var/cache/ldconfig
                  468K /var/cache/cracklib
                  40K /var/cache/dictionaries-common
                  740K /var/cache/private
                  8.0K /var/cache/PackageKit
                  2.6M /var/cache/apparmor
                  20K /var/cache/cups
                  4.0M /var/cache/fontconfig
                  13G /var/cache/apt
                  1.4M /var/cache/man
                  13G /var/cache

                  ross@ross-Alienware-15-R2:~$ sudo du -hd1 /var/cache/apt
                  13G /var/cache/apt/archives
                  13G /var/cache/apt

                  ross@ross-Alienware-15-R2:~$ sudo du -hd1 /var/cache/apt
                  13G /var/cache/apt/archives
                  13G /var/cache/apt



                  Any idea if I can delete that folder, or why it's taking up 13GB?

                  RE the partitioning:

                  ross@ross-Alienware-15-R2:~$ sudo gdisk -l /dev/sda
                  GPT fdisk (gdisk) version 1.0.5

                  Partition table scan:
                  MBR: protective
                  BSD: not present
                  APM: not present
                  GPT: present

                  Found valid GPT with protective MBR; using GPT.
                  Disk /dev/sda: 976773168 sectors, 465.8 GiB
                  Model: Samsung SSD 840
                  Sector size (logical/physical): 512/512 bytes
                  Disk identifier (GUID): 065C7579-2817-12D8-AF68-409E07B2B396
                  Partition table holds up to 128 entries
                  Main partition table begins at sector 2 and ends at sector 33
                  First usable sector is 34, last usable sector is 976773134
                  Partitions will be aligned on 2048-sector boundaries
                  Total free space is 4077 sectors (2.0 MiB)

                  Number Start (sector) End (sector) Size Code Name
                  1 2048 206847 100.0 MiB 0700 Te
                  2 206848 756570111 360.7 GiB 0700
                  3 756570112 757620735 513.0 MiB EF00 EF
                  4 757620736 839540735 39.1 GiB 2700
                  5 975849472 976771071 450.0 MiB 0700 Te
                  6 839540736 956319743 55.7 GiB 8300
                  7 956319744 975849471 9.3 GiB 8200


                  Honestly guys, I really appreciate your time and help.

                  edit - I just did "sudo apt-get autoclean" and it has freed up a lot of space, it has cleared around 9GB! I would still like to see about making the root partition bigger if possible, and my root partition is still pretty large so if you spot any other ways I can do a bit of a clean up that'd be wonderful.
                  Last edited by CanyonRoss; Feb 09, 2022, 02:06 PM.

                  Comment


                    #10
                    You don't delete that folder (/var/cache/apt/*). First, it's owned by apt and second, it is necessary!

                    What you need to do is run cleanup maintenance on your system.

                    In the konsole type: sudo apt-get clean && sudo apt-get autoclean

                    This will delete all the downloaded package files that all your updates brought down to install. Not performing regular cleanup maintenance results in what you are seeing.
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Originally posted by Snowhog View Post
                      You don't delete that folder (/var/cache/apt/*). First, it's owned by apt and second, it is necessary!

                      What you need to do is run cleanup maintenance on your system.

                      In the konsole type: sudo apt-get clean && sudo apt-get autoclean

                      This will delete all the downloaded package files that all your updates brought down to install. Not performing regular cleanup maintenance results in what you are seeing.
                      Yeah I just found this online, I've just cleaned up almost 9GB!!! I have set a reminder on my phone to do this every 3 months

                      Comment


                        #12
                        Originally posted by oshunluvr View Post
                        sudo rm -rf /var/log/journal
                        One shouldn't delete the journal directory, just its contents. IIRC journald won't start if /var/log/journal doesn't exist. Rather,
                        Code:
                        sudo rm -rf /mnt/whatever/var/log/journal/*
                        Now if the system is booted, it's better to use the systemd commands to clean things up, f.ex.
                        Code:
                        sudo journalctl --vacuum-size=100M
                        The dangerous rm -rf approach is a desperation measure to get the system back.
                        Regards, John Little

                        Comment


                          #13
                          Re. the journel folder My bad, I assume services would create their own folders. I'll have to test that out - in a VM of course.

                          Please Read Me

                          Comment


                            #14
                            Either way I'm back in. I did the same sudo apt-get autoclean on my desktop which gained 6gb of space on the root partition.
                            Last edited by Snowhog; Feb 10, 2022, 08:24 AM.

                            Comment


                              #15
                              So the same issue has seemingly occurred. Upon booting it says

                              Xsession: warning: unable to wrote to /tmp; Xsession may exit with an error.

                              I've booted a live USB stick and my root partition seemingly has over 7.7gb free so it seems like a different issue.


                              If I press esc whilst it's booting, here is the last screen before it freezes. I cannot seem to log into a console or do anything.

                              https://drive.google.com/file/d/1MG6...w?usp=drivesdk

                              Can anyone please help?

                              Many thanks.
                              Last edited by CanyonRoss; Dec 01, 2022, 03:24 PM.

                              Comment

                              Working...
                              X