Hi list, I have a SAN attached to a CentOS 4.2 server. I have expanded the size of the virtual disk within the SAN (by adding a new HD to the disk pool) and need CentOS to see the new size (CentOS see it as /dev/sdb). I'm using LVM. Do you know a method for the Volume Group to see that one of its harddisk is now bigger, without rebooting (it's not a problem with a reboot but since the LDAP directory is on this server, it is problematic). Thanks. kfx
On Wed, 2005-11-09 at 11:52 +0100, kadafax wrote:> Hi list, > I have a SAN attached to a CentOS 4.2 server. I have expanded the size > of the virtual disk within the SAN (by adding a new HD to the disk pool) > and need CentOS to see the new size (CentOS see it as /dev/sdb). I'm > using LVM. Do you know a method for the Volume Group to see that one of > its harddisk is now bigger, without rebooting (it's not a problem with a > reboot but since the LDAP directory is on this server, it is problematic). > Thanks.Anytime you expand what Linux sees as a "physical device" -- even though it's a volume over a FC HBA -- that is not always easy to address. You typically have to rescan the SCSI bus (which is what the FC HBA presents the storage as). Unfortunately, if you have filesystems mounted on that device, they may not update -- even if you're using LVM atop. Last time I checked, there was no single command to rescan the SCSI bus in RHEL. Ironically enough, I typically just do a Google search for "Linux SCSI bus scan" and run the few commands listed whenever I need to do so. But I don't know what that might do to your running storage -- it could kill your mounts. -- Bryan J. Smith b.j.smith at ieee.org http://thebs413.blogspot.com ---------------------------------------------------------------------- The best things in life are NOT free - which is why life is easiest if you save all the bills until you can share them with the perfect woman
Aleksandar Milivojevic
2005-Nov-13 04:28 UTC
[CentOS] Rescan harddisk size without rebooting
kadafax wrote:> Hi list, > I have a SAN attached to a CentOS 4.2 server. I have expanded the size > of the virtual disk within the SAN (by adding a new HD to the disk pool) > and need CentOS to see the new size (CentOS see it as /dev/sdb). I'm > using LVM. Do you know a method for the Volume Group to see that one of > its harddisk is now bigger, without rebooting (it's not a problem with a > reboot but since the LDAP directory is on this server, it is problematic).If you do "fdisk /dev/sdb", does it show you correct (new) size? Fdisk should query device directly (and not relay on cached copy of partition table in kernel). If yes, just extend partition where your physical volume is, save new partition table (fdisk will instruct kernel to re-read it), do pvresize, lvresize, and finally resize the file system (this can be done while file system is mounted at least for ext2 and ext3). If your version of LVM reports that pvresize is non-functional (I believe pvresize was implemented relatively recently for LVM2), there's couple of "dirty" tricks how to resize physical volume.