LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Iam new to Linux and want to extend space of disk partition please help. (https://www.linuxquestions.org/questions/linux-newbie-8/iam-new-to-linux-and-want-to-extend-space-of-disk-partition-please-help-4175712995/)

neal142 06-04-2022 01:10 AM

Iam new to Linux and want to extend space of disk partition please help.
 
I am new to Linux and want to extend space of disk partition please help.
I am using redhat 8 at want to increase the space of disk want to increase the /dev/sdb disk size to 10 gb more.please suggest.Its a xfs partition
[root@eofficetesting ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.7G 0 2.7G 0% /dev
tmpfs 2.8G 0 2.8G 0% /dev/shm
tmpfs 2.8G 9.2M 2.8G 1% /run
tmpfs 2.8G 0 2.8G 0% /sys/fs/cgroup
/dev/mapper/rhel-root 14G 4.4G 9.7G 31% /
/dev/sdb 10G 104M 9.9G 2% /eOfficetest
/dev/sda2 8.0G 301M 7.7G 4% /boot
/dev/mapper/rhel-home 8.0G 102M 7.9G 2% /home
/dev/mapper/rhel-var 8.0G 351M 7.7G 5% /var
/dev/sda1 6.0G 5.8M 6.0G 1% /boot/efi
tmpfs 556M 32K 556M 1% /run/user/0

[root@eofficetesting ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 6G 0 part /boot/efi
├─sda2 8:2 0 8G 0 part /boot
└─sda3 8:3 0 36G 0 part
├─rhel-root 253:0 0 14G 0 lvm /
├─rhel-swap 253:1 0 6G 0 lvm [SWAP]
├─rhel-var 253:2 0 8G 0 lvm /var
└─rhel-home 253:3 0 8G 0 lvm /home
sdb 8:16 0 20G 0 disk /eOfficetest

Fstab details:-
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=6ba6977f-8ae9-4885-b811-4cc2f2d3d68f /boot xfs defaults 0 0
UUID=48C5-9144 /boot/efi vfat umask=0077,shortname=winnt 0 2
/dev/mapper/rhel-home /home xfs defaults 0 0
/dev/mapper/rhel-var /var xfs defaults 0 0
/dev/mapper/rhel-swap none swap defaults 0 0
UUID=768fc645-c829-481f-8ecc-bd6b14d37054 /eOfficetest xfs defaults 0 0

mrmazda 06-04-2022 02:08 AM

Quote:

Originally Posted by neal142 (Post 6358603)
I am using redhat 8 at want to increase the space of disk want to increase the /dev/sdb disk size to 10 gb more.please suggest.Its a xfs partition
Code:

/dev/sdb                10G  104M  9.9G  2% /eOfficetest
...
# lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb            8:16  0  20G  0 disk /eOfficetest
...
UUID=768fc645-c829-481f-8ecc-bd6b14d37054  /eOfficetest  xfs defaults  0 0


/dev/sdb is a HDD, SSD or USB storage device, most likely the latter due to its small size. Such are not devices that normally are subject to resizing. You have no partition on /dev/sdb, only an xfs filesystem. parted /dev/sdb print or fdisk -l /dev/sdb would clarify the full device size of /dev/sdb, and whether partitioning of /dev/sdb might be possible to enable access to additional space.

syg00 06-04-2022 02:40 AM

I'd guess this is a guest - that is where these sort of queries tend to arise.
If so, add space from the host, then simplest to reboot the guest to get the new size recognised. Then use xfs_growfs to expand the filesystem to use the extra space.

neal142 06-04-2022 03:26 AM

Its a vm Machine and i Have increased the space from Hyper-v kindly find the fdisk -l output.
[root@eofficetesting ~]# fdisk -l
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 58535BBF-EDB4-40FB-81FC-E8B3D89B5D6B

Device Start End Sectors Size Type
/dev/sda1 2048 12572671 12570624 6G EFI System
/dev/sda2 12572672 29349887 16777216 8G Linux filesystem
/dev/sda3 29349888 104855551 75505664 36G Linux LVM


Disk /dev/mapper/rhel-root: 14 GiB, 15032385536 bytes, 29360128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/rhel-swap: 6 GiB, 6442450944 bytes, 12582912 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/rhel-var: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/rhel-home: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

syg00 06-04-2022 03:35 AM

It's been years since I used xfs, but you should be able to do this online - might require sudo.
Code:

xfs_growfs /eOfficetest

rtmistler 06-04-2022 06:00 PM

Research the resize2fs command. I've used it before it works fine.

syg00 06-04-2022 06:02 PM

on xfs ?.

rtmistler 06-04-2022 07:34 PM

Quote:

Originally Posted by syg00 (Post 6358758)
on xfs ?.

Have to admit it's been years, I used to create deployment disks and my script created an xfs file system, then used resize2fs to resize it. Unless I actually found a resizexfs utility instead. I used the -M flag to shrink it to the minimum size, along with the -f flag to not error out.

There's a grow xfs utility, either xfs-grow or grow-xfs, I've never used that. Yeah here it is https://www.man7.org/linux/man-pages..._growfs.8.html. Says the file system needs to be mounted... I'm not sure I like that.


All times are GMT -5. The time now is 11:53 AM.