Score:0

How do I extend the space of /dev/sda3 on Oracle Linux Server 7.9

cn flag

Disk capacity is at 105GB, but the root directory (/dev/sda3) capacity is only 39GB, I want to increase the capacity. How can we do this? By the way, the OS is Oracle Linux Server 7.9.

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         11G     0   11G   0% /dev
tmpfs            11G     0   11G   0% /dev/shm
tmpfs            11G  115M   11G   2% /run
tmpfs            11G     0   11G   0% /sys/fs/cgroup
/dev/sda3        39G   23G   17G  58% /
/dev/sda1       200M  7.9M  192M   4% /boot/efi
tmpfs           2.1G     0  2.1G   0% /run/user/0
tmpfs           2.1G     0  2.1G   0% /run/user/1000
tmpfs           2.1G     0  2.1G   0% /run/user/994

$ fdisk -l
Disk /dev/sda: 105.2 GB, 105226698752 bytes, 205520896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1    97677311    48838655+  ee  GPT
Partition 1 does not start on physical sector boundary.

$ cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="7.9"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Oracle Linux Server 7.9"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:9:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.9
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.9
us flag
You cannot extend the size of `/dev/sda3` as it is a physical device. You can however add more storage to the machine and create a volume that can be expanded and then move the content of `/dev/sda3` to the newly created volume.
sei ou avatar
cn flag
@LasseMichaelMølgaard Thank you for your response. By executing fdisk -l, it shows that my Disk capacity is 105GB, but I am currently using only 39GB, which means I can create at least a 65GB expandable volume, is that right? How should I do this?
us flag
Well if there is space left on the physical device (sda), then you could just use `resizefs /dev/sda3` to expand your volume.
sei ou avatar
cn flag
I tried everything, but could not do it. I have a feeling I'm missing some steps. ```sh $ resize2fs /dev/sda3 resize2fs 1.45.4 (23-Sep-2019) resize2fs: Bad magic number in super-block while trying to open /dev/sda3 Couldn't find valid filesystem superblock. ```
Score:0
cn flag

I tried everything, but could not do it. I have a feeling I'm missing some steps.

$ resize2fs /dev/sda3
resize2fs 1.45.4 (23-Sep-2019)
resize2fs: Bad magic number in super-block while trying to open /dev/sda3
Couldn't find valid filesystem superblock.

$ xfs_growfs /dev/sda3 -D size
meta-data=/dev/sda3              isize=256    agcount=4, agsize=2515200 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=0        finobt=0, sparse=0, rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=10060800, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=4912, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data size unchanged, skipping



# df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs   11G     0   11G   0% /dev
tmpfs          tmpfs      11G     0   11G   0% /dev/shm
tmpfs          tmpfs      11G  115M   11G   2% /run
tmpfs          tmpfs      11G     0   11G   0% /sys/fs/cgroup
/dev/sda3      xfs        39G   23G   17G  58% /
/dev/sda1      vfat      200M  7.9M  192M   4% /boot/efi
tmpfs          tmpfs     2.1G     0  2.1G   0% /run/user/0
tmpfs          tmpfs     2.1G     0  2.1G   0% /run/user/1000
tmpfs          tmpfs     2.1G     0  2.1G   0% /run/user/994
us flag
From your output it shows you are using `xfs` as filsystem. Searching online gave me that you cannot use `resize2fs`, but you should use `xfs_growfs` instead.
sei ou avatar
cn flag
Thank you. However, I ran "xfs_growfs /dev/sda3 -D size" but the result was "data size unchanged, skipping".
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.