LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-04-2022, 01:10 AM   #1
neal142
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Rep: Reputation: 0
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
 
Old 06-04-2022, 02:08 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,838
Blog Entries: 1

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Quote:
Originally Posted by neal142 View Post
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.
 
Old 06-04-2022, 02:40 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 06-04-2022, 03:26 AM   #4
neal142
LQ Newbie
 
Registered: Jun 2022
Posts: 2

Original Poster
Rep: Reputation: 0
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
 
Old 06-04-2022, 03:35 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
It's been years since I used xfs, but you should be able to do this online - might require sudo.
Code:
xfs_growfs /eOfficetest
 
Old 06-04-2022, 06:00 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Research the resize2fs command. I've used it before it works fine.
 
Old 06-04-2022, 06:02 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
on xfs ?.
 
Old 06-04-2022, 07:34 PM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by syg00 View Post
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.

Last edited by rtmistler; 06-04-2022 at 07:38 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot extend c:\win on dualboot as no unallocated space nextdoor partition, extend is greyed out on disk mgt, cyno77 Linux - Newbie 68 05-15-2021 09:11 PM
Extend Linux Partition (Extend LVM) osama.mansoor Linux - Newbie 5 11-27-2015 01:09 AM
Want to allow disk space to /boot, or want to boot from other disk (16TB) zillur Linux - Newbie 45 11-10-2015 04:32 PM
Need Help to Extend Disk Space on VPS (VMWARE) eyes_drinker Linux - Virtualization and Cloud 1 12-30-2010 04:16 PM
low disk space i like to extend it how? help me gvgvgvijayan Ubuntu 3 01-19-2010 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration