Announcement

Collapse
No announcement yet.

Running out of disk space. Something in the Kub. is accummulating log files that take up all the partition (50 Gb).

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    From the wiki:

    On a single-device filesystem, a balance may be also useful for (temporarily) reducing the amount of allocated but unused (meta)data chunks. Sometimes this is needed for fixing "file system full" issues.
    To begin the balance:

    sudo btrfs balance start --bg /

    To check it's progress:

    sudo btrfs balance status /

    The above commands assume you're running from the btrfs subvolume mounted at /

    If you have booted a different disk or from USB, mount the btrfs file system somewhere then run balance.

    Example:
    sudo mount <your btrfs fs> /mnt
    sudo btrfs balance start --bg /mnt
    sudo btrfs balance status /mnt


    You would also use balance if you add or remove a device from a btrfs file system.

    Please Read Me

    Comment


      #32
      Unfortunately, I don't know how to mount my btrfs file system. I'm know it's on /sda3, that's all, and I am working from a Live usb. What's next? I'll do everything you've specified once I know where/how to start.

      Comment


        #33
        Originally posted by RLynwood View Post
        Unfortunately, I don't know how to mount my btrfs file system. I'm know it's on /sda3, that's all, and I am working from a Live usb. What's next? I'll do everything you've specified once I know where/how to start.
        Well, this will mount it at /mnt when running from live USB.

        sudo mount /dev/sda3 /mnt

        The "mount" command lets you use the file system label, UUID or device location to mount any file system. A lot of people say "mount the partition..." but that's technically incorrect. A partition is a storage device logical boundary. You can only mount a file system.

        Once you have mounted it, run the above "...balance start..." command. Wait for it to finish then reboot as see if it works. FYI if you leave out the "-bg" part of the balance command you will be able to tell when balance is finished because the cursor will disappear when you enter the command and come back when it's done. The -bg option means "background". So, do these commands:

        sudo mount /dev/sda3 /mnt
        sudo btrfs balance start /mnt
        reboot​

        Please Read Me

        Comment


          #34
          This looks perfect. Thanks. I'll do it in a couple of hours, after a video conference call.

          Comment


            #35
            Turns out it was already mounted from your former advice. Alas, bad news though: running the balance command sequence yielded nothing. See below.

            kubuntu@kubuntu:~$ sudo btrfs balance start --bg /mnt
            WARNING:

            Full balance without filters requested. This operation is very
            intense and takes potentially very long. It is recommended to
            use the balance filters to narrow down the scope of balance.
            Use 'btrfs balance start --full-balance' option to skip this
            warning. The operation will start in 10 seconds.
            Use Ctrl-C to stop it.
            10 9 8 7 6 5 4 3 2 1
            Starting balance without any filters.
            kubuntu@kubuntu:~$ sudo btrfs balance status /mnt
            Balance on '/mnt' is running
            2 out of about 53 chunks balanced (45 considered), 96% left
            kubuntu@kubuntu:~$ sudo btrfs balance status /mnt
            No balance found on '/mnt'
            kubuntu@kubuntu:~$ sudo btrfs balance status /mnt
            No balance found on '/mnt'
            kubuntu@kubuntu:~$ sudo btrfs balance start --bg /mnt
            WARNING:

            Full balance without filters requested. This operation is very
            intense and takes potentially very long. It is recommended to
            use the balance filters to narrow down the scope of balance.
            Use 'btrfs balance start --full-balance' option to skip this
            warning. The operation will start in 10 seconds.
            Use Ctrl-C to stop it.
            10 9 8 7 6 5 4 3 2 1
            Starting balance without any filters.

            [At least an hour's wait before running the next command sequence again}

            kubuntu@kubuntu:~$ sudo btrfs balance status /mnt
            No balance found on '/mnt'
            kubuntu@kubuntu:~$


            ​It would appear that it's aying that my btrfs isn't mounted despite the mounting sequence's saying that it is mounted. I didn't reboot because it doesn't look like any repair was done. If everything is ok and I just don't see it, let me know. Otherwise, what do you make of this?

            Comment


              #36
              "No balance found..." means it finished. Balance isn't a repair tool. It checks data distribution and corrects it if anything is out of balance.

              Before rebooting, run this command:

              sudo btrfs fi df /mnt


              Please Read Me

              Comment


                #37
                The balancing instructions said it would take a long time, but it was almost instantaneous, leading me to think it didn't do anything. Anyway, here's the result:

                kubuntu@kubuntu:~$ sudo btrfs fi df /mnt
                Data, single: total=46.51GiB, used=46.17GiB
                System, DUP: total=8.00MiB, used=16.00KiB
                Metadata, DUP: total=518.00MiB, used=426.30MiB
                GlobalReserve, single: total=65.55MiB, used=0.00B
                kubuntu@kubuntu:~$


                ​Doesn't "Data ... total=46.51Gib ..." mean that 46.51 GiB, or rather about 27 GiB of inappropriate "data", is still clogging the partition?
                Last edited by RLynwood; Jan 19, 2024, 08:18 AM.

                Comment


                  #38
                  Did you see my response to your last instructions?

                  Comment


                    #39
                    Originally posted by RLynwood View Post
                    The balancing instructions said it would take a long time, but it was almost instantaneous, leading me to think it didn't do anything. Anyway, were's the result:

                    kubuntu@kubuntu:~$ sudo btrfs fi df /mnt
                    Data, single: total=46.51GiB, used=46.17GiB
                    System, DUP: total=8.00MiB, used=16.00KiB
                    Metadata, DUP: total=518.00MiB, used=426.30MiB
                    GlobalReserve, single: total=65.55MiB, used=0.00B
                    kubuntu@kubuntu:~$


                    ​Doesn't "Data ... total=46.51Gib ..." mean that 46.51 GiB, or rather about 27 GiB of inappropriate "data", is still clogging the partition?
                    No. that means you have 46.51GiB of your total available space allocated to Data (vs. System or Metadata) and 46.17GiB is used. Note it's GiB (i in the middle) not GB.

                    Convert 46,51GiB to GB and you get 49.93973. Your drive is simply full.

                    As I stated several posts ago, 50GB is plenty for Kubuntu but not if you have 24GB in your @home. Either add some space to the file system or delete a few gigs of stuff from your home or some large apps like Libreoffice or snaps and flatpaks.

                    Please Read Me

                    Comment


                      #40
                      Thank you very much, and please stay with me.
                      Btw, what does GiB stand for? I thought that was just a more technical way of saying GB.
                      I can't delete anything because I can't boot into that OS. I thought that the cl instructions you gave were going to get me access to the partition so I could determine where the clogging was so as to clean it up. I do have an adjacent, empty 50 GB partition, but I don't know how to get at the Kub partition in order to expand it.
                      I believe I can clean out at least some data--actual data, which belong in my data partition and that haven't finished moving yet. I had moved some of it already. But somehow, it's gotten filled up even more. And I haven't added any data that I wanted to store; I've been storing all new data in the data partition. That's why I don't know how the OS partition has gotten filled up and want to understand and to clean out. And that's why I thought I was seeing a replay of the previous experience of its getting filled up with log files (I was able to use a Filelite-like program to find and delete nearly all of them).

                      Comment


                        #41
                        Well, OK you're wrong that you can't delete anything just because it won't boot. Just mount it in the LiveUSB session, navigate to it, and delete stuff: sudo rm <whatever>

                        Since it's BTRFS if you have a free and empty 50GB partition, add it to the file system. It's one of the best features of BTRFS and simple as heck.

                        They way I see it you have three options:
                        1. Add the empty partition to your existing file system.
                        2. Create a second BTRFS file system on the empty partition, move your @home subvolume to it, leaving you with a 50GB / partition and a 50gb /home partition.
                        3. Mount the file system and delete stuff.
                        The first option is by far the least amount of work. However, you may not prefer it so I gave you the other options to consider. Myself, I have done this (combining partitions) many times.

                        To add the empty partition, it's as simple as sudo btrfs device add <device> <mountpoint>

                        Steps needed:
                        1. Boot to the LiveUSB.
                        2. Mount the full BTRFS file system.
                        3. Add the empty device to the existing BTRFS file system.
                        4. Reboot
                        Assuming the full BTRFS file system is on /dev/sda3 and the empty partition is /dev/sda4, the actual commands are;

                        sudo mount /dev/sda3 /mnt
                        sudo btrfs device add /dev/sda4 /mnt


                        That's literally it. BTRFS will automatically allocate space on the second device as it's needed. The empty partition doesn't even have to be on the same drive

                        If you want to see the actual change, do this first:

                        sudo btrfs fi usage

                        The output will have way more detail than the df command output.
                        Then do the device add as I have above and re-run device usage and you will see the additional free space.

                        You should then be able to reboot with a 100GB file system and 50% full.

                        As an example, I did this just now. I took a BTRFS file system on my system and added a blank (no format) partition to it. Here's the output of "fi usage" so you can see the results:

                        Before device add:
                        Code:
                        stuart@office:~$ sudo btrfs fi usage /mnt/990pro2
                        Overall:
                        Device size: 931.51GiB
                        Device allocated: 3.02GiB
                        Device unallocated: 928.50GiB
                        Device missing: 0.00B
                        Used: 288.00KiB
                        Free (estimated): 929.50GiB (min: 465.25GiB)
                        Free (statfs, df): 929.50GiB
                        Data ratio: 1.00
                        Metadata ratio: 2.00
                        Global reserve: 3.50MiB (used: 0.00B)
                        Multiple profiles: no
                        
                        Data,single: Size:1.00GiB, Used:0.00B (0.00%)
                        /dev/nvme2n1p2 1.00GiB
                        
                        Metadata,DUP: Size:1.00GiB, Used:128.00KiB (0.01%)
                        /dev/nvme2n1p2 2.00GiB
                        
                        System,DUP: Size:8.00MiB, Used:16.00KiB (0.20%)
                        /dev/nvme2n1p2 16.00MiB
                        
                        Unallocated:
                        /dev/nvme2n1p2 928.50GiB

                        After device add:
                        Code:
                        stuart@office:~$ sudo btrfs fi usage /mnt/990pro2
                        Overall:
                           Device size:                   1.77TiB
                           Device allocated:              3.02GiB
                           Device unallocated:            1.77TiB
                           Device missing:                  0.00B
                           Used:                        288.00KiB
                           Free (estimated):              1.77TiB      (min: 908.18GiB)
                           Free (statfs, df):             1.77TiB
                           Data ratio:                       1.00
                           Metadata ratio:                   2.00
                           Global reserve:                3.50MiB      (used: 0.00B)
                           Multiple profiles:                  no
                        
                        Data,single: Size:1.00GiB, Used:0.00B (0.00%)
                          /dev/nvme2n1p2          1.00GiB
                        
                        Metadata,DUP: Size:1.00GiB, Used:128.00KiB (0.01%)
                          /dev/nvme2n1p2          2.00GiB
                        
                        System,DUP: Size:8.00MiB, Used:16.00KiB (0.20%)
                          /dev/nvme2n1p2         16.00MiB
                        
                        Unallocated:
                          /dev/nvme2n1p2        928.50GiB
                          /dev/nvme3n1p3        885.86GiB​
                        You can clearly see the size increase.

                        Note that if the partition you're going to add is not empty - as in already formatted, it will prompt you to use the "-f" flag to force a reformatting of the partition you are adding.

                        If you want to discuss the other options, let me know.
                        Last edited by Snowhog; Jan 18, 2024, 01:50 PM.

                        Please Read Me

                        Comment


                          #42
                          Thanks again. This looks great.
                          Will you explain what GiB is?

                          I don't understand option 3.

                          It looks like I've already added btrfs to /dev/sda4 or created it separately (I tried to add /sda3's btrfs to /sda4 per your instructions (see next line), & it said it was already there).
                          "To add the empty partition, it's as simple as sudo btrfs device add <device> <mountpoint>" So, it's sudo btrfs /dev/sda add /dev/sdb /mnt ? This didn't work: it said that btrfs already was in /dev/sda4. So I tried to force the /sda3 btrfs to overwrite /sda4's btrfs and got this result:
                          ubuntu@kubuntu:~$ sudo btrfs device add /dev/sda4 -f
                          btrfs device add: not enough arguments: 1 but at least 2 expected

                          Please show me what I'm doing wrong.

                          ​​
                          Last edited by RLynwood; Jan 18, 2024, 04:36 PM.

                          Comment


                            #43
                            Originally posted by RLynwood View Post
                            Btw, what does GiB stand for?
                            See wikipedia page about them..
                            Regards, John Little

                            Comment


                              #44
                              Will do. Thank you.

                              Comment


                                #45
                                Well, that wasn't nearly as simple an answer as GiB[i]=gigabits (shouldn't this be GBi?), GB=gigabytes. Twenty years ago, this would have interested me. Now I just want to use my computer and functionally understand whatever terms I need to to communicate here.

                                Comment

                                Working...
                                X