Operating System - Linux
1820259 Members
2900 Online
109622 Solutions
New Discussion юеВ

Online resizing Linux disks & filesystems

 
noldi
Valued Contributor

Online resizing Linux disks & filesystems

Hello,

in a somewhat follow on question to the QLogic
Multipath thread http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=954749
I experimented with the online filesystem resize theme.

When I grow a LUN on an EVA, how do I make that
added space at the end of the LUN available to
the filesystem while it is online?

It seems that I'm struggling with the issue of
extending the partition table, since the
command "ext2online" requires the underlying
SCSI device/partition to be extended in order
to successfully extend the ext3 filesystem.
Something I managed to get done only after an
umount/mount of the said device.

Anybody knows a reasonable approach to extend
a Linux (RH EL 4.0, kernel 2.6) filesystem
online?

Thank's again & best Regards,

Arnold Sutter, Tristar/redIT
16 REPLIES 16
Ivan Ferreira
Honored Contributor

Re: Online resizing Linux disks & filesystems

I think that you will need LVM to extend the size of a partition/volume online, using the lvextend command.

So, after growing the VDISK in the EVA, you should run lvextend and then ext2online.

OR

You can try using parted, parted has the resize partition command, but normally, partitions changes are not detected until next reboot on mounted disks.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
noldi
Valued Contributor

Re: Online resizing Linux disks & filesystems

Hello Ivan,

thank's for your response.

I've thought about the LVM approach too, but
for this I would have to extend the
underlying physical disk (something like
"pvextend" or "pvresize"), which again would
require an online extension to the partition
table, something that doesn't seem to be
easily available.

Any other thoughts?

Best Regards,

Arnold Sutter, Tristar/redIT
Andrej Vavro
Frequent Advisor

Re: Online resizing Linux disks & filesystems

I played with it some time ago. It is (was) not possible to resize online. fdisk to create a partition and then reboot to re-read partition table.

regards,
Andrej
Matthew_50
Valued Contributor

Re: Online resizing Linux disks & filesystems

if you would like to use ext2online to extend/reduce filesystem on the fly, your kernel have to support the option. which means you might need to re-config your kernel.
Ivajlo Yanakiev
Respected Contributor

Re: Online resizing Linux disks & filesystems

I have LVM and I can on line resize my FS without any problem.
You no need lvextend ext2online make lvextend for you.
noldi
Valued Contributor

Re: Online resizing Linux disks & filesystems

Hello all,

one way we do it with EVA is the following:

1) Extend the size of the LUN on the storage
subsystem with additional space at the end.

2) Modify the disk partition, so the
additional space is available to the system

3) Extend the filesystem in order to make
use of the additional space of the device

It seems that step 2 is the problem here.

Of course, I can always add an additional
LUN to the LVM volume group and extend the
logical volume. But this might not always
be desired if I want to extend the EXISTING
device.

Best Regards,

Arnold Sutter, Tristar/redIT
Ivan Ferreira
Honored Contributor

Re: Online resizing Linux disks & filesystems

Hi noldi, the step 2 can you do it ONLINE?

That means, can you modify the partition after growing the VDISK in the EVA, without dismount/reboot the system?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
noldi
Valued Contributor

Re: Online resizing Linux disks & filesystems

Ivan,

that's exactly the point. So far, I could
not successfully execute Step 2 online
without dismount/mount'ing the device.

Best Regards,

Arnold
Steven E. Protter
Exalted Contributor

Re: Online resizing Linux disks & filesystems

resize2fs ??

In most SAN environments when space is added on the SAN you have to boot the box to get the space recognized.

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
noldi
Valued Contributor

Re: Online resizing Linux disks & filesystems

Steven,

not with Tru64 UNIX. This is a notable
example where you can edit/extend the disklabel
without umount/reboot and then extend
the AdvFS filesystem online.

Also, I think some recent VxVM versions
on some platforms can do this.

noldi
Ivajlo Yanakiev
Respected Contributor

Re: Online resizing Linux disks & filesystems

Ouuu I get whay you want.
You are right.
If you use some LUNs for VG you can not extend that LUNs online.
You can extend online LV but you can not extend PV.

I do not know any way to do that sorry
Ivan Ferreira
Honored Contributor

Re: Online resizing Linux disks & filesystems

See this document:

http://www1.us.dell.com/content/topics/global.aspx/power/en/ps1q03_michael

After changing the physical and logical drive layers, notify the OS of the changes. Rebooting the system is the easiest way to do so├в the new disks will be detected at system startup├в but Linux-based systems can notify the OS without rebooting.

If an existing logical drive was expanded, tell the OS to remove the drive and then add it back to the OS. The /proc/scsi/scsi file lists all SCSI devices currently known to the OS, and when written to, this file informs the OS of changes. The following command adds a drive to the OS:


echo "scsi add-single-device Host Bus Id Lun" > /proc/scsi/scsi
(where Host, Bus, Id, and Lun correspond to the new drive parameters)


So, it seems that even when you can grow your partition without rebooting, it cannot be done while the filesystem is active.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
gatouillat
Occasional Advisor

Re: Online resizing Linux disks & filesystems

Hello,

I'm working on an EVA 5000 and Linux RHEL 4 and QLogic FBA.
I want to create a vdisk on the SAN of 5 Go for example. Linux sees it at /dev/sda. I make a physical lvm partition on /dev/sda, (/dev/sda1), with the total space, then create a volume group, then logcial volume, then a filesystem.
Now I want to extend my vdisk to 10 Go.
I know I can't extend my physical lvm partition, but I think when I rescan my scsi-bus, linux will see the new size of my device sda. Then, create a second physical LVM partition (/dev/sda2), add it to my existing volume group, then extend my logical volume, then my filesystem with ext2online.
All of this must be done ONLINE.

What do you think about this ? do you think is it possible ?

Thanks.
Pierre-Damien GATOUILLAT / SCC
Ivan Ferreira
Honored Contributor

Re: Online resizing Linux disks & filesystems

If I would extend a VG in linux, I would create a new vdisk instead of extending the current vdisk. Then add the new vdisk to the vg, and extend the lv as you want.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
gatouillat
Occasional Advisor

Re: Online resizing Linux disks & filesystems

Hello Ivan,

Yes, I agree with you, it is a solution, but I don't think it is optimal for the san. Have 1 vdisk for 1 partition is best than 2 vdisks for 1 partition, I think at the level of organizing data on the disks of the san.
Under windows, the things I talk on my last post are possible, online, I think under linux, it will be possible. I'm going to test tomorrow, I will inform you of my tests.

Thanks.
Pierre-Damien GATOUILLAT / SCC
gatouillat
Occasional Advisor

Re: Online resizing Linux disks & filesystems

Hello,

I'm facing a lot of problem, following my friday's tests. The only thing which works is resizing off-line, ie, resizing the vdisk on the SAN, remove the qla driver on linux, modprobe the driver, the new size of the vdisk was correctly detected, I create a new partition on /dev/sda (sda2) for a new lvm physical device, extend the VG, next the LV.

When I create a second vdisk and present it to the Linux, I can't see it. Linux only detect a new device sgX (X=1 or 2), but no sdX (normally sdb). I try the qla driver of linux kernel and of HP. Nothing nothing nothing. I think about a problem of max_luns (max_scsi_luns for kernel 2.4), because the redhat kernel is not compiled with CONFIG_SCSI_MULTI_LUN=y. So I try to boot with option max_luns=128, nothing better. I also try max_scsi_luns, nothing. I also try to pass this option to scsi_mod in /etc/modprobe.conf

If someone has an idea... Perhaps I have to recompile the kernel, but in this case I will lost the redhat support... I don't understand why the CONFIG_SCSI_MULTI_LUN is not enabled on redhat kernel...

Thanks for your answer.
Pierre-Damien GATOUILLAT / SCC