LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-24-2017, 10:46 AM   #1
Ozono
LQ Newbie
 
Registered: Aug 2015
Posts: 8

Rep: Reputation: Disabled
Question Adding 2 SAS disks


Hi guys,

I am a bit lost adding a couple of disks of 146Gb to an existing server a HP Proliant DL380 g5 without losing any data.

I am running an old version of "oracle linux":
[root@ovs62 ~]# uname -a
Linux ovs62.mydomain.com 2.6.39-300.32.5.el5uek #1 SMP Mon Aug 5 11:19:15 PDT 2013 x86_64 x86_64 x86_64 GNU/Linux

[root@ovs62 ~]# cat /proc/partitions
major minor #blocks name

104 0 71652960 cciss/c0d0
104 1 104391 cciss/c0d0p1
104 2 3148740 cciss/c0d0p2
104 3 1052257 cciss/c0d0p3
104 4 67344480 cciss/c0d0p4
104 16 716708248 cciss/c0d1
104 17 430024688 cciss/c0d1p1

So I want c0d1p1 to have 716708248 blocks. I found some instructions (https://www.howtoforge.com/linux_res..._partitions_p2) but I am a bit worried as they include deleting the journal from /dev/cciss/c0d1p1 and then deleting c0d1.

I guess the easy way is to take a backup of my disk but that is easiest said than done.

Thanks in advance for any help, advise warning, etc
 
Old 05-24-2017, 12:28 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You should provide df and fdisk output like that shown in the link. While partitions shows sizes it doesn't give any clue as to what the partitions are used for like fdisk does.

Also if you're using OEL are you also using ASM on any of these partitions? If so you should show the ASM volume configurations.

What are you trying to accomplish by changing partition size? Is it something that could be accomplished more easily by adding a partition from the new disks to a metadisk or LVM or ASM setup?

Finally: OEL5 is a fork of RHEL5. RHEL5 went end of support at the start of April so you probably want to check whether OEL5 did as well as I suspect it probably did. There are known security issues with RHEL5. If at possible you should think about moving on from 5 to at least 6 and even better to 7.
 
Old 05-25-2017, 04:43 AM   #3
Ozono
LQ Newbie
 
Registered: Aug 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
Post

Hi MensaWater,

Thanks for replying. That disk is used for data, more specifically is a repository of virtual machines in OVS:

[root@ovs62 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p2 3.0G 1.2G 1.6G 43% /
/dev/cciss/c0d1p1 404G 215G 169G 56% /disk2
/dev/cciss/c0d0p1 99M 30M 64M 32% /boot
tmpfs 354M 0 354M 0% /dev/shm
/dev/cciss/c0d0p4 64G 45G 16G 75% /scratch
none 354M 40K 354M 1% /var/lib/xenstored


[root@ovs62 ~]# fdisk -l

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes
255 heads, 63 sectors/track, 8920 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 13 104391 83 Linux
/dev/cciss/c0d0p2 14 405 3148740 83 Linux
/dev/cciss/c0d0p3 406 536 1052257+ 82 Linux swap / Solaris
/dev/cciss/c0d0p4 537 8920 67344480 83 Linux

Disk /dev/cciss/c0d1: 733.9 GB, 733909245952 bytes
255 heads, 63 sectors/track, 89226 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d1p1 * 1 53536 430024688 83 Linux


As OS I am using Oracle VM server release 3.2.6 which is a cut down version of Oracle Linux server release 5.7

I'm not using ASM volumes.

Q- What are you trying to accomplish by changing partition size? To have more space in that particular disk as I have to share the space with another servers, it makes sense to have it all in one.

I am not using LVM either, so it is pure partitioning.

If I could I will install something else, but this is a working server part of a pool in Oracle Virtual Server, so any big modifications will just screw up the setup.

Also the server is a Proliant DL380 g5 a bit old for Oracle 7, or at least I couldn't find ISO to install it on that hardware, the higher I managed to go was 6.4 in a similar server.

Thanks,
 
Old 05-25-2017, 01:00 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
This makes your life easy. The link is talking about changing the boot disk (sda in their case).

In your case your boot disk is /dev/cciss/c0d0 and the other space you want to use is on a separate disk, /dev/cciss/c0d1, for which you show only one partition, /dev/cciss/c0d1p1.

Since partition you want to change is on a separate disk altogether you don't need to do any reboots.

Since the second disk only has the one partition you can simply grow the partition of that disk to use all the space of that disk.

1) Be sure you have a valid backup of /disk2
Even though this shouldn't lose data you always want a backup "just in case".

2) Stop any applications or processes that are using filesystem, /disk2.
You can run "lsof /disk2" to see any processes using it.

3) Run "umount /disk2"

4) Run "parted /dev/cciss/c0d1"
parted is similar to fdisk but is a little easier to use and has a resize built into it

5) Run "print" to verify it has only one partition.

6) To resize the partition, use the resize command followed by the partition number, the starting place in megabytes, and the end place in megabytes.
NOTE: This is an EXAMPLE - use the values derived by reviewing the above "print". The example is "guestimates" made by me based on your fdisk output (1 for partition, 1 for start megabyte and 750592 for end megabyte):
Example command is "resize 1 1 750592"

7) Run "print" again to verify the partition size has grown.
Note that parted's resize changes the size of the partition and the filesystem on it.

8) Run "fsck /dev/cciss/c0d1p1" just to verify the filesystem is OK.

9) Remount the filesystem. (If it is in fstab you can just run "mount /disk2".
After that df -hP /disk2 should show it using the additional filesystem.

Of course none of that uses the 2 new 146 GB SAS you said you bought but it doesn't appear you need them to accomplish what you say is your goal. Since you say it is a VM I'm not sure what those disks would do for you.

As to your other points - I did mention going to "at least 6" so if you know 6.4 works I'd suggest doing that if at all possible. As noted 5 has no support as well as known security issues.

If you're running 64 bit 5 on your Proliant I'd expect a 64 bit 6 to work - both were based on 2.6.x kernels.
 
Old 05-26-2017, 11:09 AM   #5
Ozono
LQ Newbie
 
Registered: Aug 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi MensaWater,

Very good set of instructions, thanks for that. However I got stuck again

When trying:

(parted) unit B
(parted) print

Model: Compaq Smart Array (cpqarray)
Disk /dev/cciss/c0d1: 733909245951B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 16384B 440345296895B 440345280512B primary ext3 boot

(parted) resize 1 16384 733909245951
Error: File system has an incompatible feature enabled.
(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.

I can only think of 2 things here, the "Partition Table: msdos" and Flags "boot". But I do not know how to change them.

I tried to get more information with
(parted) check 1
Error: File system has an incompatible feature enabled.

Also I tried all the 10 options on "# tune2fs -O ^* /dev/cciss/c0d1" to always get

tune2fs 1.39 (29-May-2006)
tune2fs: Bad magic number in super-block while trying to open /dev/cciss/c0d1
Couldn't find valid filesystem superblock.

MensaWater: "Of course none of that uses the 2 new 146 GB SAS you said you bought but it doesn't appear you need them to accomplish what you say is your goal. Since you say it is a VM I'm not sure what those disks would do for you."

The 2 disks of 146Gb were added to a logical drive following this procedure https://h20565.www2.hpe.com/hpsc/doc...ocLocale=en_US
so now they are part of /dev/cciss/c0d1.

Thanks & regards,
 
Old 05-26-2017, 01:04 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I haven't done this but the link here has a post by "wizard" that suggests if you use fdisk to remove the partition then re-add it with the new size you shouldn't lose any data:
http://forums.fedoraforum.org/showthread.php?t=86137

The OP of the question which has the same error you saw replies to "wizard" that it worked for him.
 
1 members found this post helpful.
Old 05-30-2017, 11:56 AM   #7
Ozono
LQ Newbie
 
Registered: Aug 2015
Posts: 8

Original Poster
Rep: Reputation: Disabled
Well that did not work as expected. However I managed to increase the space but at loss, but it didn't matter as the data lost was a backup for other system, so it was expendable. These are the instructions of what I did based on "wizard"s:

1. First comes the obligatory 'backup everything' message.

2. Umount the partition /disk2

3. First, list the partition table -

fdisk -l /dev/cciss/c0d1

4. Write down the start and end cylinders for /disk2 partition.
Device Boot Start End Blocks Id System
/dev/cciss/c0d1p1 1 53536 430024688 83 Linux

5. Delete the partition. Yes, delete the partition. Trust me. You backed everything up anyway, right?

6. Using fdisk, add a partition with the same partition number and *same starting cylinder* as the partition you deleted. Make it big enough to take up all the free space you cleared for it. Save it with w.

7. What you'll have now is a bigger partition with the original size filesystem on it. Use

resize2fs /dev/cciss/c0d1 to grow the filesystem to fit the new partition size.

This just threw the error:
resize2fs 1.39 (29-May-2006)
resize2fs: Bad magic number in super-block while trying to open /dev/cciss/c0d1p1
Couldn't find valid filesystem superblock.

8. So what the hell, I created a filesystem in that partition with

/sbin/mkfs -t ext3 /dev/cciss/c0d1p1

Maximum filesystem blocks value was given by default so nothing to think about. After few minutes the filesystem was created. Double check UUID of the device with blkid, make some changes in /etc/fstab to allocate the new UUID and I have my disk enlarged!

Well I just wanted to thank you for your help MensaWater.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Adding physical RAID disks via BASH script? your_shadow03 Linux - Newbie 13 08-04-2015 08:47 AM
Adding disks to RH9 Raid 0 ? netboy_541 Linux - Server 3 01-18-2008 08:05 AM
Slackware and SAS disks sunkenmel Slackware - Installation 3 08-28-2007 04:07 PM
SAS & partitioning of disks rblampain Linux - General 2 05-14-2007 06:48 AM
grub hangs when adding sata disks pifou_gp Linux - Hardware 2 11-27-2006 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:17 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