HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Extending disk in LINUX

 
Nagu SR
Frequent Advisor

Extending disk in LINUX

Hi,

I have RHEL-5 installed. Its a VMware VM (SCSI adapter-LSI Logic).
I have extended the virtual disk (/dev/sda1--boot; /dev/sda2--LVM) from the VMware end.

How to extend the disk in LINUX??

Is it possible to do without rebooting VM?


Regards,

Nagu
5 REPLIES
Steven E. Protter
Exalted Contributor

Re: Extending disk in LINUX

Shalom Nagu,

If the system is configured with lvm, use lvextned

If not, there is nothing you can do.

It is possible to extend without booting the vm machines. It is not really possible to get any of them to use more space without a hard reboot.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Nagu SR
Frequent Advisor

Re: Extending disk in LINUX

hello,

Thanks for the reply.

I need to extend the disk size (pv size) in LINUX. lvextend will not give any option to extend the existing disk.


Please see my partition info.

[root@unixtest ~]# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 6549 MB, 6549824512 bytes
255 heads, 63 sectors/track, 796 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 652 5132767+ 8e Linux LVM


Here I have extended the disk by 1.1GB. But how do I extend /dev/sda2 which is LVM?


And also, what is the command in LINUX to detect the new disks? (Is it possible withour rebooting machine?)

Nagu

Hemmetter
Esteemed Contributor

Re: Extending disk in LINUX

Hi Nagu

to scan sc scsibusses for new disks
find your controller under
/sys/class/scsi_host/hostX/

by e.g.
# cat /sys/class/scsi_host/host*/proc_name

then
# echo "- - - " > /sys/class/scsi_host/host$X/scan

check dmesg output for new disks.

rgds
HGH
Nagu SR
Frequent Advisor

Re: Extending disk in LINUX

Hi,

I could scan the new LUN with the help of rescan-scsi-bus.sh

But how to extend the disk in redhat?

Regards,

Nagu
Court Campbell
Honored Contributor

Re: Extending disk in LINUX

You need to download a system rescue cd.

http://www.sysresccd.org/Main_Page

Boot the virtual off the iso. once it is up run startx. then open a terminal in the gui and run gparted. Choose your disk in gparted and resize the partition. Once all that is done, boot back into the OS and run vgextend, lvextend, resize2fs,etc.


basically you need a live cd with gparted on it.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"