0

My /home directory quickly runs out of disk space, so I want to expand it from 32GB to 64GB.

[me@centos7 ~]$ df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 7.8G     0  7.8G   0% /dev
tmpfs                    7.8G     0  7.8G   0% /dev/shm
tmpfs                    7.8G  9.3M  7.8G   1% /run
tmpfs                    7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/mapper/centos-root   29G   18G   11G  64% /
/dev/sdb                  32G   19G   11G  64% /home     <------ this one
/dev/sdd                  32G  2.0G   28G   7% /u02
/dev/sdc                  32G  8.7G   22G  30% /u01
/dev/sda1                497M  343M  155M  69% /boot
tmpfs                    1.6G   12K  1.6G   1% /run/user/42
tmpfs                    1.6G     0  1.6G   0% /run/user/1001

My machine is a CentOS 7 virtual machine in VirtualBox that has several snapshots:

VM with several snapshots

The machine has 4 partitions:

Four partitions

Initially, SATA Port 1 (home.vdi) had only 32GB, but I was able to change this to 64GB via the Virtual Media Manager:

Virtual Media Manager

Upon changing the virtual size to 64GB, the df output remains the same as above. Here is the output of lsblk:

[me@centos7 ~]$ lsblk
NAME                         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                            8:0    0   32G  0 disk
├─sda1                         8:1    0  500M  0 part /boot
└─sda2                         8:2    0 31.5G  0 part
  ├─centos-root              253:0    0 28.3G  0 lvm  /
  └─centos-swap              253:1    0  3.2G  0 lvm  [SWAP]
sdb                            8:16   0   32G  0 disk /home
sdc                            8:32   0   32G  0 disk /u01
sdd                            8:48   0   32G  0 disk /u02
sr0                           11:0    1 58.3M  0 rom
loop0                          7:0    0  100G  0 loop
└─docker-253:0-67412413-pool 253:2    0  100G  0 dm
loop1                          7:1    0    2G  0 loop
└─docker-253:0-67412413-pool 253:2    0  100G  0 dm

This is the print output of fdisk for /dev/sda, /dev/sdb, /dev/sdc, and /dev/sdd:

[me@centos7 ~]$ sudo fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk /dev/sda: 34.4 GB, 34359738368 bytes, 67108864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00024fc7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    67108863    33041408   8e  Linux LVM

Command (m for help): q

[me@centos7 ~]$ sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x898c2f25.

Command (m for help): p

Disk /dev/sdb: 34.4 GB, 34359738368 bytes, 67108864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x898c2f25

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): q

[me@centos7 ~]$ sudo fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x44d41ba0.

Command (m for help): p

Disk /dev/sdc: 34.4 GB, 34359738368 bytes, 67108864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x44d41ba0

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): q

[me@centos7 ~]$ sudo fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x620f9140.

Command (m for help): p

Disk /dev/sdd: 34.4 GB, 34359738368 bytes, 67108864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x620f9140

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): q

My operating system details are:

[me@centos7 ~]$ uname -a
Linux centos7 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

I saw these instructions but I don't know how to apply them for my case or if they are applicable at all to my case. What exact steps or command options do I need to perform in order for my /home to have 64GB space? Thank you.

  • 1
    Did you reboot the VM after resizing home.vdi? – u1686_grawity Jun 30 '21 at 09:17
  • 1
    Does this answer your question? [Used VBoxManage modifyhd --resize, actual size did not change](https://superuser.com/questions/1302973/used-vboxmanage-modifyhd-resize-actual-size-did-not-change) – gronostaj Jun 30 '21 at 09:38
  • @user1686, yes, I have rebooted the VM several times, but still same `df` output (32GB for /dev/sdb) – hermit.crab Jul 01 '21 at 01:54
  • @gronostaj thank you for the tip. unfortunately, I think this topic is too advanced for me that I can't follow the instructions. `fdisk` does not recognize a partition table in /dev/sdb as shown above, and I think this may be complicating things. – hermit.crab Jul 01 '21 at 01:58
  • 1
    No, because it's not a partitioned disk, most of what's in that thread is not applicable at all. (Besides, that thread assumes that the _block device_ (sdb) is already reporting the correct size, which in your case is not happening.) – u1686_grawity Jul 01 '21 at 08:18

0 Answers0