1

I do not want to destroy my vm :) I am new at linux (start up on a budget)

Here are my partitions:

Filesystem                   Size     Used      Avail   Use%     Mounted on
udev                         3.9G     0         3.9G    0%       /dev
tmpfs                        798M     924K      797M    1%       /run
/dev/mapper/ubuntu-root      4.6G     3.9G      442M    90%      /
tmpfs                        3.9G     8.0K      3.9G    1%       /dev/shm
tmpfs                        5.0M     0         5.0M    0%       /run/lock
tmpfs                        3.9G     0         3.9G    0%       /sys/fs/cgroup
/dev/mapper/ubuntu-tmp       453M     2.3M      423M    1%       /tmp
/dev/sda1                    990M     145M      779M    16%      /boot
/dev/mapper/ubuntu-home      1.8G     128M      1.6G    8%       /home
/dev/mapper/ubuntu-var       2.7G     1.4G      1.2G    55%      /var
tmpfs                        798M     0         798M    0%       /run/user/1000

total                        24G      5.5G      18G     24%      -

It looks like I should have close to 400GB but my partitions total ("total" above) shows 24GB

I am nearly out of partition space on / and need to expand it:

/dev/mapper/ubuntu-root 4.6G 3.9G 442M 90% /

When looking at my virtual disk sizes:

H/W path           Device      Class      Description
=====================================================
/0/100/10/0.0.0    /dev/sda    disk       1073MB Virtual disk
/0/100/10/0.1.0    /dev/sdb    disk       284GB Virtual disk
/0/100/10/0.3.0    /dev/sdd    disk       107GB Virtual disk

How do I know what is on /dev/sdb?

How do I know what is on /dev/sdd?

Is that just free space?

How do I expand /?


requested info:

 NAME          MAJ:MIN   RM  SIZE RO TYPE MOUNTPOINT
 fd0             2:0      1    4K  0 disk
 sda             8:0      0    1G  0 disk
 └─sda1          8:1      0 1022M  0 part /boot
 sdb             8:16     0  265G  0 disk
 sdc             8:32     0   50G  0 disk
 ├─ubuntu-root   253:0    0  4.7G  0 lvm  /
 ├─ubuntu-swap   253:1    0  1.9G  0 lvm  [SWAP]
 ├─ubuntu-tmp    253:2    0  476M  0 lvm  /tmp
 ├─ubuntu-home   253:3    0  1.9G  0 lvm  /home
 └─ubuntu-var    253:4    0  2.8G  0 lvm  /var
 sdd             8:48     0  100G  0 disk
 sr0             11:0     1 1024M  0 rom

after applying solution

 fd0               2:0    1     4K  0 disk
 sda               8:0    0     1G  0 disk
 └─sda1            8:1    0  1022M  0 part /boot
 sdb               8:16   0   265G  0 disk
 └─sdb1            8:17   0   265G  0 part
   ├─ubuntu-root 253:0    0 204.7G  0 lvm  /
   ├─ubuntu-home 253:3    0   7.9G  0 lvm  /home
   └─ubuntu-var  253:4    0  22.8G  0 lvm  /var
 sdc               8:32   0    50G  0 disk
 ├─ubuntu-root   253:0    0 204.7G  0 lvm  /
 ├─ubuntu-swap   253:1    0   1.9G  0 lvm  [SWAP]
 ├─ubuntu-tmp    253:2    0   476M  0 lvm  /tmp
 ├─ubuntu-home   253:3    0   7.9G  0 lvm  /home
 └─ubuntu-var    253:4    0  22.8G  0 lvm  /var
 sdd               8:48   0   100G  0 disk
 sr0              11:0    1  1024M  0 rom
 
2
  • Please add lsblk output to your question. Commented Nov 5, 2020 at 6:20
  • @VojtechTrefny added lsblk result Commented Nov 5, 2020 at 7:21

1 Answer 1

1

So your sdb and sdd drives seems to be unused. You are using LVM, so you first need to add these drives to your existing volume group and then resize the root (or home or var logical volumes).

  • Create partitions on sdb and sdd using fdisk (it's an interactive tool, just run fdisk /dev/sdb, use n to add new partition, accept all defaults for start, size etc. and use w to write changes, repeat for /dev/sdd).
  • Create physical volume on the new partitions pvcreate /dev/sdb1, pvcreate /dev/sdd1.
  • Add the physical volumes to your ubuntu volume group using vgextend ubuntu /dev/sdb1, vgextend ubuntu /dev/sdd1
  • Resize your root logical volume lvresize -L+100G -r ubuntu/root (this will grow your root volume by 100 GiB, adjust the number based on your needs, you might want to resize var and home as well).

Based on the filesystem you are using, you might need to do the last step from a LiveCD, some filesystems can't be resized while in use (and it's generally better to do storage operations on inactive devices). And don't forget to make a backup in case something goes wrong.

3
  • I applied your solution. (didn't use all the unallocated space yet) How does it look? Commented Nov 5, 2020 at 17:47
  • Thanks for the step-by-step, very appreciated Commented Nov 5, 2020 at 18:27
  • 1
    It looks good. You don't need to use all empty space, you can keep some space unused for future changes. Commented Nov 5, 2020 at 18:34

You must log in to answer this question.

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