LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   RHEL 3: Steps of expanding file system (add new SCSI disks) to existing SW RAID & LVM (https://www.linuxquestions.org/questions/linux-general-1/rhel-3-steps-of-expanding-file-system-add-new-scsi-disks-to-existing-sw-raid-and-lvm-402065/)

atman1974 01-11-2006 11:52 AM

RHEL 3: Steps of expanding file system (add new SCSI disks) to existing SW RAID & LVM
 
Hello,

I have a Linux server installed with RHEL 3, with Software RAID-1 & LVM enabled. Now I need to add new SCSI disks to increase the file system space. Here are the steps I want to follow (after checking the SW RAID howto, LVM howto & this site). But because the server is stored with important data and I want to make sure these steps are the right ones. So I post here and ask for your help to double check it.

Thanks in advance.

!!! Backup the important data in case something goes wrong.

#poweroff

Add two new (same size) SCSI disks & Power up

There should be devices /sdc /sdd

#fdisk /sdc
to create partition /sdc1 with 0xfd type
#fdisk /sdd
to create partition /sdd1 with 0xfd type

#more /etc/raidtab
There are already two RAID-1 devices, /dev/md0 & /dev/md1, in the system, so the next RAID device should be /dev/md2.

#mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1

This is the step I'm not 100% sure. Could this command destroy my original data on the other two RAID-1 devices?

#mdadm --detail /dev/md2
#mdadm -E /dev/sdc1

Do I need to restart the system here or not?

The following steps are just following the LVM howto. (RAID is my VG name, /dev/RAID/Home is the file system I want to grow.)

#/sbin/pvcreate /dev/md2

#/sbin/vgextend RAID /dev/md2

#/sbin/vgdisplay RAID

#/sbin/lvextend +150000 /dev/RAID/Home /dev/md2

#/sbin/lvdisplay /dev/RAID/Home

#umount /dev/RAID/Home

#export E2FSADM_RESIZE_CMD=ext2resize

#e2fsadm /dev/RAID/Home -L+150G

#mount /dev/RAID/Home

It should be finished here. There is one last question though. From the vgdisplay command, I found that LV has a limit of 255.9GB space. But according to the LVM howto, LV should have 2 (or 1) TB max space in one single LV (kernel 2.4). Can I change my LV max size to 2TB or not? If yes, how should I do it?

Many thanks.

WhatsHisName 01-12-2006 12:51 PM

If you plan to do this from your RHEL3 installation, then you will need to reboot after creating the partitions using fdisk.

You will get a message from fdisk telling you that linux is using the old partition tables. If you try to create the raid without rebooting, then you should get an error message stating that the partitions donít exist. You should be able to complete all remaining steps without rebooting.

Since you appear to be using LVM1 (2.4 kernel) which I have not worked with, Iím not going to make any comments about your proposed LVM modifications, as my LVM2-based advice might be wrong.

atman1974 01-12-2006 10:49 PM

Thanks for reply. As a matter of fact, I had already taken my own risk and go ahead without overseeing by an expert eye, which had been proved not a good approach! :)

I did not have the problem you mentioned, because the two disks actually have been partitioned before (exactly the same partition I want except the type is not "0xfd" but "0x83"). I changed the type and go ahead with the creation of RAID. The system did not complain.

The RAID & LVM creation seems fine untill the last step,
Quote:

#e2fsadm /dev/RAID/Home -L +150G
It gave error message:
Quote:

# e2fsadm --size +150G LogicalVolumePath
# e2fsadm -- new size too large for "LogicalVolumePath"
# e2fsadm -- size of "LogicalVolumePath" would be invalid
I guess this is a typical newbie error who did not read the howto carefully enough. I already did the LV extention and then e2fsadm will try to do that again. By google search, I understood my mistake and everything is settled now.

Thanks anyway.


All times are GMT -5. The time now is 09:08 AM.