0

Currently I am unable to run or install anything on SLES SP4 system because insufficient space in /root. Could you please suggest a way to increase the disk space for /root from /home on SLES SP4?

Below is the current disk usage:

df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  4.0M     0  4.0M   0% /dev
tmpfs          tmpfs     126G     0  126G   0% /dev/shm
tmpfs          tmpfs      51G   10M   51G   1% /run
tmpfs          tmpfs     4.0M     0  4.0M   0% /sys/fs/cgroup
/dev/sda2      btrfs      40G   29G   11G  74% /
/dev/sda2      btrfs      40G   29G   11G  74% /.snapshots
/dev/sda2      btrfs      40G   29G   11G  74% /boot/grub2/i386-pc
/dev/sda2      btrfs      40G   29G   11G  74% /opt
/dev/sda2      btrfs      40G   29G   11G  74% /root
/dev/sda2      btrfs      40G   29G   11G  74% /srv
/dev/sda2      btrfs      40G   29G   11G  74% /tmp
/dev/sda2      btrfs      40G   29G   11G  74% /usr/local
/dev/sda2      btrfs      40G   29G   11G  74% /boot/grub2/x86_64-efi
/dev/sda2      btrfs      40G   29G   11G  74% /var
/dev/sda3      xfs       876G   74G  802G   9% /home
/dev/sda1      vfat      511M  8.3M  503M   2% /boot/efi
overlay        overlay   876G   74G  802G   9% /home/docker_new/docker/overlay2
tmpfs          tmpfs     126G   20K  126G   1% /home/docker_new/docker/containers
tmpfs          tmpfs      26G  4.0K   26G   1% /run/user/1000


lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                         8:0    0 931.5G  0 disk
├─sda1                      8:1    0   512M  0 part /boot/efi
├─sda2                      8:2    0    40G  0 part /var
│                                                   /boot/grub2/x86_64-efi
│                                                   /usr/local
│                                                   /tmp
│                                                   /srv
│                                                   /root
│                                                   /opt
│                                                   /boot/grub2/i386-pc
│                                                   /.snapshots
│                                                   /
├─sda3                      8:3    0 875.5G  0 part /home
└─sda4                      8:4    0  15.5G  0 part [SWAP]
sdb                         8:16   0 931.5G  0 disk
├─sdb1                      8:17   0   512M  0 part
├─sdb2                      8:18   0     1G  0 part
└─sdb3                      8:19   0 464.3G  0 part
  └─ubuntu--vg-ubuntu--lv 254:0    0 464.3G  0 lvm



Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  538MB   537MB   fat32                 boot, esp
 2      538MB   43.5GB  42.9GB  btrfs
 3      43.5GB  984GB   940GB   xfs
 4      984GB   1000GB  16.6GB  linux-swap(v1)        swap

2 Answers 2

0

Boot of a rescue CD or something. You can't shrink an xfs file-system. Back it up using xfsdump. Delete the partition, create a new, smaller one at the end of the free space and restore your data to it, create a new partition in the free space, add that to your btrfs.

4
  • Could you please share the commands to do this in the current scenario? Commented Feb 25, 2023 at 3:42
  • @tink- could you please share the steps to implement the suggested solution? Commented Feb 25, 2023 at 5:49
  • If I had a suse system w/ btrfs and xfs for testing I might consider it, even though it would still depend on the tooling of the rescueCD you choose and how the set-up on your machine represents itself to that. But as it stands I couldn't possibly - hence the coarse outline. @user2077648
    – tink
    Commented Feb 25, 2023 at 20:06
  • Could you please share the steps to convert xfs to btrfs on SLES SP4( it is okay if the data is lost) Commented Feb 26, 2023 at 3:41
0

As you have snapshots enabled, the default setting might use too much space for snapshots (see the official documents for space recommendations, maybe openSUSE:Snapper Tutorial).

Try du -sh /.snapshots to get the space consumed for snapshots.

So obviously you could "produce" some free space by deleting snapshots using the snapper command (like snapper -v cleanup timeline), but see the manual page snapper(8) and snapper-configs(5) first!

You can also review the settings in /etc/snapper/configs/root for example.

A final word of warning: Use the snapper command to clean up snapshots; I ruined a system by deleting the wrong "snapshot".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .