LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 10-12-2009, 02:33 PM   #1
abylin1
LQ Newbie
 
Registered: Jan 2008
Posts: 19

Rep: Reputation: 0
Expanding LUN, anything I need to do in RHEL4 to?


Hello,

I'm running RHEL4 Update 4 32-bit and have an Oracle database on it with the datafiles mounted to /oracle, which is a CX3-10 DAS (Dell Poweredge 2850 server).

I'm running out of space on my DAS and need to expand one of the LUNs. Is there anything I need to configure in Red Hat to accommodate the expanded size of the LUN?

Laura
 
Old 10-12-2009, 05:10 PM   #2
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
If your using logical volumes I would suggest presenting a new LUN to the server and simply adding the disk to the volume group, you should be able to grow the filesystem then. Being RHEL4 you'll have to umount the filesystem to grow it safely.
If its a partition then I would suggest creating a new LUN of the right size, use logical volumes and move the data across, that way next time you'll have it alot easier.
 
Old 10-13-2009, 07:53 AM   #3
abylin1
LQ Newbie
 
Registered: Jan 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Hello,

Maybe my first post wasn't very clear...

The LUN has already been presented to Red Hat, I'm simply wanting to expand the size of the LUN on the DAS-side of things (not creating a new LUN). I was planning on shutting down the OS and then expanding the LUN. After starting up the OS again, is there anything I need to configure in the OS to recognize the change, or will Red Hat see that same LUN is still presented to it, and now it's just a bigger size?

Thank you,
Laura
 
Old 10-13-2009, 06:37 PM   #4
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Laura,

Once you've rebooted the O/S should see the disk as a different size, then all you have to do is resize it.
We don't normally expand LUN's but there are two ways you could do it. And of course always make sure you have a backup (and your have tested a restore too! (been caught out by that as well))



1 - shutdown your server (just to be safe).
2 - Expand LUN
3 - Boot server using a live CD such as gpartd and grow the disk/file system.

or

3 - boot server back into redhat, umount the disk and use fdisk to increase the parition size, then grow the filesystem. You will need to delete the partition and re-create it at the larger size. This shouldn't destroy the data, just resize the partition, then grow the fs.

Last edited by FragInHell; 10-13-2009 at 07:04 PM. Reason: typo again
 
Old 10-14-2009, 05:54 AM   #5
abylin1
LQ Newbie
 
Registered: Jan 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Hi, I'm not super confident in my Linux abilities quite yet. It looks to me like I will need to use parted because when I do an fdisk -l, I see this:
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdb: 1477.1GB

Device Boot = /dev/sdb1
Start = 1
End = 179585
Blocks = 1442514047+
Id = ee
System = EFI GPT

Could you explain a little more what commands I need to issue to increase the partition size? Will this destroy any existing data on the LUN if it is unmounted?

Last edited by abylin1; 10-14-2009 at 09:27 AM.
 
Old 10-14-2009, 09:37 PM   #6
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Ok this is what I would do.

I'm going to assume its /dev/sdb1

Is this an itanium box btw?
If its I've not done it for a itanium before and I normally use fdisk. I'll include the fdisk instructions as I don't use parted you may need to look up the alternatives for parted.
You don't need to do so many fsck's as I've done here but for the time it takes to fsck vs the time it takes to restore etc I think its worth it.

When you delete the partition your only remove it from the partition table, so the data still exists on the disk. The disk will need to be unmounted in order to make all of these changes. But as always...Backup First.....

umount the volume
fsck it (fsck -f /dev/sdb1)
shutdown the server.

expand the LUN.
restart the server.
unmount the volume
fsck it again !
now resize the partition (this would be for fdisk)
fdisk /dev/sdb
delete partition 1 (d)
create partition 1 (n then 1) (using the entire disk)
save (w)
now we need to grow the filesystem as well
resize2fs -p /dev/sdb1
mount the file system.
 
Old 10-26-2009, 09:21 AM   #7
abylin1
LQ Newbie
 
Registered: Jan 2008
Posts: 19

Original Poster
Rep: Reputation: 0
I tried your commands, and the filesystem seemed to resize and is showing the correct size when I issue a "fdisk -l". However, when I do a "df -h", I still see the original size. ??
 
Old 10-26-2009, 06:22 PM   #8
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Can you post the output of fdisk -l and df -h etc please.
Did the resize2fs work ok?
 
Old 10-26-2009, 07:43 PM   #9
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
It is wise to do "fsck -f /dev/sdb1" after resize2fs command.

Also, do you by any change have LVM partitions on top of /dev/sdb1 ? if so, you need to also expand the LVM volumes and partitions.
 
Old 10-29-2009, 02:54 PM   #10
abylin1
LQ Newbie
 
Registered: Jan 2008
Posts: 19

Original Poster
Rep: Reputation: 0
I'm not convinced the resize2fs worked. I'm questioning this because shouldn't "df -h" show the correct size of the filesystem?

This is the output of "fdisk -l" and "df -h":

fdisk -l

Warning: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdb: 2954.2GB, 2954268770304 bytes
255 heads, 63 sectors/track, 359169 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device boot = /dev/sdb1
Start = 1
End = 267350
Blocks = 2147483647+
Id = ee
System = EFI GPT

df -h

Device Boot = /dev/sdb1
Size = 1.4T
Used = 1.1T
Avail = 210G
Use% = 84%
Mounted on = /oracle

DrLove73, no LVM partitions on top of /dev/sdb1.

Last edited by abylin1; 10-29-2009 at 02:57 PM.
 
Old 10-29-2009, 07:38 PM   #11
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
http://en.wikipedia.org/wiki/GUID_Partition_Table
Quote:
According to Apple,[1] "Do not assume that the {LBA} size is always going to be 512 bytes." Modern storage devices such as solid-state drives may contain 1024-byte LBAs.
Since you have GPT on your HDD, cylindars/heads.... size does not have to be correct. Since this is the first time I have heard of GPT, I can not help you any further, but someone must know.
 
  


Reply



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
[SOLVED] trouble expanding 4+TB GPT partition after expanding hardware RAID-5 volume muad'dib Linux - Enterprise 6 09-26-2009 05:01 PM
dd a 450GB LUN fastlane Linux - Software 1 07-23-2008 11:53 AM
LUN Device Mapping: 2 devices map to same lun DantePasquale Linux - Distributions 0 09-24-2007 02:59 PM
Unable to view Lun on RHEL4 AS limp2cwm Linux - Enterprise 7 03-02-2007 04:33 AM
remote backup from RHEL4 to another RHEL4? dkgoalie Linux - Newbie 2 10-27-2006 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 03:11 PM.

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
Open Source Consulting | Domain Registration