Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

  1. #1

    Default Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    I'm on the brink of running out of space on my root partition and will have to steal some space from /home.

    I've done this in the past on a different distribution, and if I'm not mistaken I should be able to do this without doing it on a live distro (if not, how do I deal with LUKS?) as long as I unmount my /home partition (growing should be fine on a mounted partition). However, I'm not sure how to either just log in as root or unmount the /home partition after booting like normal and changing run level. I tried appending "init=/bin/bash" after the kernel line in GRUB without success.

    df -h (parts removed)
    Code:
    Filesystem                      Size  Used Avail Use% Mounted on
    devtmpfs                        3.9G     0  3.9G   0% /dev
    /dev/mapper/system-root          30G   28G  1.7G  95% /
    /dev/sda2                       408M  100M  320M  24% /boot
    /dev/sda1                       156M  4.7M  152M   3% /boot/efi
    /dev/mapper/system-home         185G   85G  101G  46% /home
    fdisk -l (parts removed)
    Code:
    Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
    
    Disklabel type: gpt
    
    Device       Start       End   Sectors  Size Type
    /dev/sda1     2048    321535    319488  156M EFI System
    /dev/sda2   321536   1157119    835584  408M Linux filesystem
    /dev/sda3  1157120 468860927 467703808  223G Linux LVM
    
    
    Disk /dev/mapper/cr_ata-KINGSTON_RBU-SC100S37240GE_50026B7252088406-part3: 223 GiB, 239462252544 bytes, 467699712 sectors
    
    Disk /dev/mapper/system-swap: 8 GiB, 8589934592 bytes, 16777216 sectors
    
    Disk /dev/mapper/system-root: 30 GiB, 32212254720 bytes, 62914560 sectors
    
    Disk /dev/mapper/system-home: 185 GiB, 198654820352 bytes, 387997696 sectors
    btrfs filesystem show
    Code:
    Label: none  uuid: 001ceb05-5f5e-4369-8bc8-171eeda1bb2a
            Total devices 1 FS bytes used 26.92GiB
            devid    1 size 30.00GiB used 30.00GiB path /dev/mapper/system-root
    
    Label: none  uuid: 7cbf403a-5ae6-42b6-900e-1c162b47fd02
            Total devices 1 FS bytes used 83.94MiB
            devid    1 size 408.00MiB used 252.00MiB path /dev/sda2
    lvs && vgs && pvs
    Code:
      LV   VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
      home system -wi-ao---- 185.01g                                                    
      root system -wi-ao----  30.00g                                                    
      swap system -wi-ao----   8.00g                                                    
    
      VG     #PV #LV #SN Attr   VSize   VFree
      system   1   3   0 wz--n- 223.02g 4.00m
    
      PV                                                                   VG     Fmt  Attr PSize   PFree
      /dev/mapper/cr_ata-KINGSTON_RBU-SC100S37240GE_50026B7252088406-part3 system lvm2 a--  223.02g 4.00m
    Basically I want to add 20GB from home to root.

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,339
    Blog Entries
    15

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    Hi
    Is the btrfs / just allocated or used? Have the maintenance clean up routines run for btrfs? Not running snapshots?

    Code:
    snapper list
    btrfs fi usage /
    systemctl list-timers
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    To be perfectly honest I just went with the default options when I first installed the distro and the only thing I've hated so far is dealing with btrfs. My routine (after first running out of space a long time ago and quickly finding out about btrfs through Google) has been more or less to delete all snapshots after an update then do a full balance (which lately has been failing).

    It does look like I'm genuinely running out of space though. Had to remove Chromium and LibreOffice after the the last couple of updates.

    snapper list
    Code:
    Type   | # | Pre # | Date                     | User | Cleanup | Description           | Userdata
    -------+---+-------+--------------------------+------+---------+-----------------------+---------
    single | 0 |       |                          | root |         | current               |         
    single | 1 |       | Fri Nov  6 01:17:37 2015 | root |         | first root filesystem |
    btrfs fi usage /
    Code:
    Overall:
        Device size:                  30.00GiB
        Device allocated:             30.00GiB
        Device unallocated:            1.00MiB
        Device missing:                  0.00B
        Used:                         27.70GiB
        Free (estimated):              1.68GiB      (min: 1.68GiB)
        Data ratio:                       1.00
        Metadata ratio:                   2.00
        Global reserve:               87.27MiB      (used: 0.00B)
    
    Data,single: Size:27.69GiB, Used:26.00GiB
       /dev/mapper/system-root        27.69GiB
    
    Metadata,DUP: Size:1.12GiB, Used:867.59MiB
       /dev/mapper/system-root         2.25GiB
    
    System,DUP: Size:32.00MiB, Used:16.00KiB
       /dev/mapper/system-root        64.00MiB
    
    Unallocated:
       /dev/mapper/system-root         1.00MiB
    systemctl list-timers
    Code:
    NEXT                         LEFT                LAST                         PASSED             UNIT                  
    Fri 2018-02-09 15:00:00 CET  20min left          Fri 2018-02-09 14:00:22 CET  39min ago          snapper-timeline.timer
    Sat 2018-02-10 00:00:00 CET  9h left             Fri 2018-02-09 10:09:41 CET  4h 29min ago       logrotate.timer       
    Sat 2018-02-10 13:21:01 CET  22h left            Fri 2018-02-09 13:21:01 CET  1h 18min ago       snapper-cleanup.timer 
    Sat 2018-02-10 13:26:34 CET  22h left            Fri 2018-02-09 13:26:34 CET  1h 13min ago       systemd-tmpfiles-clean
    Mon 2018-02-12 00:00:00 CET  2 days left         Mon 2018-02-05 00:00:57 CET  4 days ago         btrfs-balance.timer   
    Thu 2018-03-01 00:00:00 CET  2 weeks 5 days left Thu 2018-02-01 08:48:44 CET  1 weeks 1 days ago btrfs-scrub.timer     
    
    6 timers listed.
    Pass --all to see loaded but inactive timers, too.

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,339
    Blog Entries
    15

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    Hi
    Did you also modify the snapper config /etc/snapper/configs/root?

    Logs and or coredumps taking up space?
    Code:
    coredumpctl list
    du -sh /var/lib/systemd/coredump/
    du -sh /var/log
    (run to clean out logs, but leave last 2 days)
    journalctl --vacuum-time=2d
    Manually run the balance;
    Code:
    /usr/share/btrfsmaintenance/btrfs-balance.sh
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    I did modify the snapper config, but it's been a while so I can't remember what exactly. The intent was at least to save space.

    First 'du' command outputted 0. With journal vacuum 112MB was freed.

    /usr/share/btrfsmaintenance/btrfs-balance.sh
    Code:
    Before balance of /
    Data, single: total=27.69GiB, used=25.87GiB
    System, DUP: total=32.00MiB, used=16.00KiB
    Metadata, DUP: total=1.12GiB, used=867.28MiB
    GlobalReserve, single: total=87.14MiB, used=0.00B
    Filesystem               Size  Used Avail Use% Mounted on
    /dev/mapper/system-root   33G   30G  2.0G  94% /
    
    After balance of /
    Data, single: total=27.31GiB, used=25.87GiB
    System, DUP: total=32.00MiB, used=16.00KiB
    Metadata, DUP: total=1.12GiB, used=866.69MiB
    GlobalReserve, single: total=86.55MiB, used=0.00B
    Filesystem               Size  Used Avail Use% Mounted on
    /dev/mapper/system-root   33G   30G  2.0G  94% /

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,339
    Blog Entries
    15

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    Quote Originally Posted by Serophis View Post
    I did modify the snapper config, but it's been a while so I can't remember what exactly. The intent was at least to save space.

    First 'du' command outputted 0. With journal vacuum 112MB was freed.

    /usr/share/btrfsmaintenance/btrfs-balance.sh
    Code:
    Before balance of /
    Data, single: total=27.69GiB, used=25.87GiB
    System, DUP: total=32.00MiB, used=16.00KiB
    Metadata, DUP: total=1.12GiB, used=867.28MiB
    GlobalReserve, single: total=87.14MiB, used=0.00B
    Filesystem               Size  Used Avail Use% Mounted on
    /dev/mapper/system-root   33G   30G  2.0G  94% /
    
    After balance of /
    Data, single: total=27.31GiB, used=25.87GiB
    System, DUP: total=32.00MiB, used=16.00KiB
    Metadata, DUP: total=1.12GiB, used=866.69MiB
    GlobalReserve, single: total=86.55MiB, used=0.00B
    Filesystem               Size  Used Avail Use% Mounted on
    /dev/mapper/system-root   33G   30G  2.0G  94% /
    Hi
    I would have a look around /var and /usr to see where possible space is being consumed. You could have lots of rpm's cached perhaps.... for example;
    Code:
    du -sh /usr
    du -sh /var
    du -sh /var/cache
    See how that goes first, if you can get a few more GB back I think you will be fine with what you have.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    du -sh /usr && du -sh /var && du -sh /var/cache
    Code:
    13G     /usr
    1.3G    /var
    278M    /var/cache

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,339
    Blog Entries
    15

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    Quote Originally Posted by Serophis View Post
    du -sh /usr && du -sh /var && du -sh /var/cache
    Code:
    13G     /usr
    1.3G    /var
    278M    /var/cache
    Hi
    OK, so drill down into /usr (FYI my system uses 6G here) see what is lurking... Also check /tmp. Not running a web server or such, if so check /srv.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    /tmp is 2GB. In /usr, bin is around 600MB, lib64 (2.7GB excluding subfolders) and share are each 4GB, and src 1.5GB.

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,339
    Blog Entries
    15

    Default Re: Shrinking /home in order to grow root partition (btrfs, encrypted drive)

    Quote Originally Posted by Serophis View Post
    /tmp is 2GB. In /usr, bin is around 600MB, lib64 (2.7GB excluding subfolders) and share are each 4GB, and src 1.5GB.
    Hi
    OK, well /tmp is just as it says temp stuff... looks like it's never been cleaned or..or are you logging something there?

    I also don't see a systemd-tmpfiles-clean.service if you manually run, does this reduce /tmp usage?
    Code:
    systemctl start systemd-tmpfiles-clean.service
    systemctl status systemd-tmpfiles-clean.service
    So you build the nvidia proprietary driver manually (uses about 300M every build), or some other driver manually?

    You have a lot in /src, old kernels?
    Code:
    ls -la /boot/initrd*
    zypper se -si kernel-default
    Has the purge kernels service run?
    Code:
    systemctl status purge-kernels.service
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •