3

I was given a CentOS 9 Linux distribution server inside a virtual machine to whom I can connect using ssh protocol (from command line). I am running svn checkout command in order to clone a remote repository, whose size is around 10GB, into my workspace in CentOS /home/<user>/my/workspace, but after some time I get:

No space left on device

And the procedure fails.

If I run df -h command I get:

Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 7.7G 0 7.7G 0% /dev/shm
tmpfs 3.1G 1.4M 3.1G 1% /run
efivarfs 256K 31K 221K 13% /sys/firmware/efi/efivars
/dev/mapper/cs-root 9.4G 1.1G 8.4G 11% /
/dev/mapper/cs-usr 7.5G 5.0G 2.5G 67% /usr
tmpfs 1.0G 0 1.0G 0% /tmp
/dev/mapper/cs-var 7.5G 949M 6.6G 13% /var
/dev/sda2 947M 507M 441M 54% /boot
/dev/mapper/cs-var_tmp 1.9G 46M 1.9G 3% /var/tmp
/dev/mapper/cs-opt 7.5G 112M 7.4G 2% /opt
/dev/sda1 571M 7.5M 564M 2% /boot/efi
/dev/mapper/cs-home 7.5G 7.5G 20K 100% /home
/dev/mapper/cs-var_log 3.8G 584M 3.2G 16% /var/log
/dev/mapper/cs-var_log_audit 3.8G 3.3G 524M 87% /var/log/audit
tmpfs 1.6G 28K 1.6G 1% /run/user/974
tmpfs 1.6G 28K 1.6G 1% /run/user/582851889

And, as you can see, /home directory is full at 100% (Size is 7.5G, Used is 7.5G, Avail is 20K).

How can I increase the space available to make the svn checkout command successful?

Also, the output of lsblk command is:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 1T 0 disk
├─sda1 8:1 0 572M 0 part /boot/efi
├─sda2 8:2 0 953M 0 part /boot
├─sda3 8:3 0 54.2G 0 part
│ ├─cs-root 253:0 0 9.3G 0 lvm /
│ ├─cs-swap 253:1 0 3.7G 0 lvm [SWAP]
│ ├─cs-usr 253:2 0 7.5G 0 lvm /usr
│ ├─cs-opt 253:3 0 7.5G 0 lvm /opt
│ ├─cs-home 253:4 0 7.5G 0 lvm /home
│ ├─cs-var_log_audit 253:5 0 3.7G 0 lvm /var/log/audit
│ ├─cs-var 253:6 0 7.5G 0 lvm /var
│ ├─cs-tmp 253:7 0 2G 0 lvm
│ ├─cs-var_log 253:8 0 3.7G 0 lvm /var/log
│ └─cs-var_tmp 253:9 0 1.9G 0 lvm /var/tmp
└─sda4 8:4 0 1M 0 part
sr0 11:0 1 1024M 0 rom

And the output of vgs command is:

 VG #PV #LV #SN Attr VSize VFree
 cs 1 10 0 wz--n- <54.18g 4.00m

The output of parted -l command is:

Model: VMware Virtual disk (scsi)
Disk /dev/sda: 1100GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
 1 1049kB 601MB 600MB fat32 EFI System Partition boot, esp
 2 601MB 1600MB 999MB xfs
 3 1600MB 59.8GB 58.2GB lvm
 4 59.8GB 59.8GB 1049kB bios_grub

Since volume group cs free space is 4.00m (almost full), my idea is to:

1. Create a new partition

Since /dev/sda disk has much unallocated space, I can create a new partition for that disk:

sudo fdisk /dev/sda

In the dialog that will pop up, press n (new partition), p (partition type is primary), 5 (partition number), default first sector, +/-<size>{K,B,M,G,...} (space of the partition, in my case I may allocate +50G). Then change the partition type pressing t, and then 8e to set the partition type to Linux LVM. Finally, save the changes using w

2. Create a physical volume (PV)

Create a physical volume:

sudo pvcreate /dev/sda5

Verify the operation using sudo pvs

3. Extend the volume group (VG)

Extend the volume group cs:

sudo vgextend cs /dev/sda5

Verify the operation using sudo vgs

4. Extend the logical volume (LV)

Extend the logical volume and resize the file system cs-home:

sudo lvextend -L +<size> -r /dev/mapper/cs-home

I can use -l +<percentage>%FREE instead of -L. Note the -r flag to resize underlying filesystem together with the logical volume. Verify the operation using sudo df -h

I do not need to format the file system and mount it since I am extending an existing LV.

Since I am new to Linux administration, does my solution make sense? Should I extend /dev/sda3 partition, instead of creating a new one (i.e., /dev/sda5)?

asked Mar 19 at 9:20
8
  • 2
    friendly remark from a developer who's been there: if your SVN repo is 10 GB in size, and if the year is after 2010, then you should migrate away from SVN; probably to git (which makes this especially low in pain with gitsvn); the speedup in git clones (the equivalent of a svn checkout) alone makes this worthwhile. It's really more than a decade overdue. Talk to whoever keeps this in SVN. Commented Mar 19 at 9:26
  • @MarcusMüller Hello Marcus. Of course, thank toy. My company is still using subversion, though Commented Mar 19 at 9:33
  • 2
    yes, I see that. you need to talk to them. This is really an unnecessary burden on them; and, it's a hiring problem (everyone these days knows git, few know SVN. And those who know both will tend to leave for companies that don't force them to use SVN.) Commented Mar 19 at 9:35
  • 1
    @StéphaneChazelas I've heard that a couple of times, but in my experience, the compressed object storage of git just beats the hell out of that. If you really want to achieve that , you can achieve the same with git (but, um, you really don't want to, usually): git clone -n --depth=1 --filter=tree:0 -- "${repo}" && cd -- "${repodir}" && git sparse-checkout set --no-cone subdir1 subdir2 [...] && git checkout; this will download the needed objects to check out the specified directories only in the last step. Commented Mar 19 at 9:45
  • 1
    @MarcusMüller, thanks I wasn't aware of that. It will come handy for my checkouts of BSD subtrees for those that have switched to git. Commented Mar 19 at 9:49

1 Answer 1

4

Since I am new to disk management, does it make sense?

yes, (my first reaction was, wait there's a fourth mini partition, if this is MSDOS partition tabling, then it might not be possible to create more partitions, but this is GPT!).

I'd add a -r to your lvextend command line: if your /home runs on a file system that can be enlarged while mounted, this will automatically do that; otherwise you're missing the step where you make the filesystem actually fill the (now larger) volume.

answered Mar 19 at 9:31
5
  • That's right! I've just edited my post. You can check it out, please Commented Mar 19 at 9:46
  • well, if you added what I proposed, why would I now say something else than in my answer? Commented Mar 19 at 9:47
  • I'd move the grub partition to sectors 34 to 2047 and extend sda3 Commented Mar 19 at 9:51
  • @StéphaneChazelas Why and how did you notice this? Commented Mar 19 at 9:56
  • 1
    @tail Not sure what you mean, your parted output indicates sectors 34 (after the end of the GPT structures) to 2047 are free, which is a good place to store the EF02 bios boot partition (used for the case where the machine is booted in legacy more instead of EFI) which is currently otherwise in the middle of your disk (sda4). Once that's moved, you're free to extend sda3 Commented Mar 19 at 10:08

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.