LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-18-2010, 08:03 AM   #1
JALITE
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Rep: Reputation: 1
How to expand disk in Linux


We have VMware Redhat Linux, LVM. A virtual disk of 10GB was added additional 10GB space, fdisk -l does not see the new enlarged size.
How to make the new size become visible? Is reboot required?
 
Old 10-18-2010, 08:21 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,919

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by JALITE View Post
We have VMware Redhat Linux, LVM. A virtual disk of 10GB was added additional 10GB space, fdisk -l does not see the new enlarged size.
How to make the new size become visible? Is reboot required?
Depends on how you added the disk. A reboot certainly wouldn't hurt.

But if the new space was added as another disk drive, rebooting won't make it show up. You'll need to make a file system on it, and mount it, or create/add it to an LVM group.
 
Old 10-18-2010, 08:48 AM   #3
JALITE
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Original Poster
Rep: Reputation: 1
new 10GB space was added to an existing Linux virtual disk, say disk2 from VMware or /dev/sdb1 in client Redhat Linux.
/dev/sdb has already had filesystems built under LVM vg/lv, and are currently being used.
I should be able expand filesystems if I can see the new disk size, may be I need to reboot the Linux and extend the disk partition to make new disk size visible?

Last edited by JALITE; 10-18-2010 at 08:50 AM.
 
Old 10-18-2010, 09:15 AM   #4
matt1123
LQ Newbie
 
Registered: Oct 2010
Distribution: Debian, openSUSE
Posts: 12

Rep: Reputation: 0
To make use of the space you will probably have to extend the partition with something like the gparted live cd.
 
Old 10-19-2010, 05:32 AM   #5
JALITE
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Original Poster
Rep: Reputation: 1
problem solved. steps are:
- rescan sdd for new space
# echo 1 > /sys/block/sdd/device/rescan
- create new partition sdd2 from new added space
# fdisk /dev/sdd
- make kernel aware of new partition
# partprobe -s /dev/sdd
- create pv from new partition and add to existing vg
# pvcreate /dev/sdd2
# vgextend vg_test /dev/sdd2
- extend lv and filesystem
# lvextend -L +10g /dev/vg_test/testlv /dev/sdd2
- extend filesystem
# resize2fs /dev/mapper/testlv

Thanks for all the response
 
1 members found this post helpful.
Old 10-19-2010, 05:45 AM   #6
Mark1986
Member
 
Registered: Aug 2008
Location: Netherlands
Distribution: Xubuntu
Posts: 87

Rep: Reputation: 11
Quote:
Originally Posted by JALITE View Post
problem solved. steps are:
- rescan sdd for new space
# echo 1 > /sys/block/sdd/device/rescan
- create new partition sdd2 from new added space
# fdisk /dev/sdd
- make kernel aware of new partition
# partprobe -s /dev/sdd
- create pv from new partition and add to existing vg
# pvcreate /dev/sdd2
# vgextend vg_test /dev/sdd2
- extend lv and filesystem
# lvextend -L +10g /dev/vg_test/testlv /dev/sdd2
- extend filesystem
# resize2fs /dev/mapper/testlv

Thanks for all the response

Thank you for posting this solution, it was really helpful and learned me a lot.
 
Old 04-15-2014, 05:19 PM   #7
MattPie
LQ Newbie
 
Registered: Jan 2005
Location: Maryland, USA
Posts: 5

Rep: Reputation: 2
As an alternate to creating a new partition, you can expand the original partition. Use fdisk to delete the partition (yes, that's scary but it's OK), then create a new partition with the same start but to the end of the disk. After that, pvresize /dev/sdd1 will update the size of the PV, lvresize to increase the size of the logical volume.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Expand disk space in VMware ESXI VM Antonio85 Linux - Virtualization and Cloud 2 08-25-2010 02:10 AM
How to expand disk space cghcgh Linux - Newbie 7 07-08-2008 10:09 AM
LXer: HP To Expand Effort On Linux PCs LXer Syndicated Linux News 0 09-21-2007 11:11 AM
expand root partition to occupy whole disk JohnGalt007 Linux - Software 4 01-09-2007 07:03 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration