Koozali.org: home of the SME Server

Harddisk change

Offline jncs

  • *
  • 31
  • +0/-0
Harddisk change
« on: July 02, 2009, 02:16:29 AM »
Hi!

I've been searching here and I've already read a lot of topics but I can't get what I need...

I have a 160GB SATA hard disk and I would like to upgrade to a 250 GB SATA hard disk.


I use PARAGON PARTITION MAGIC to make a hard copy from one disk to another.

After the copy, the larger disk have about 90 GB of unused space. I want to use that space but I can't resize my partition because it's a part of a raid (/dev/md2).

I've tried this approach (http://forums.contribs.org/index.php/topic,34413.0.html) but it doesn't work.
At the end, when I restart the server I get the message "Kernel Panic" and my server frozen!

How can I grow up my partition?
« Last Edit: July 02, 2009, 02:26:08 AM by jncs »
Jorge Silva

Offline thomasch

  • *
  • 232
  • +0/-0
Re: Harddisk change
« Reply #1 on: July 02, 2009, 06:32:49 AM »

Offline jncs

  • *
  • 31
  • +0/-0
Re: Harddisk change
« Reply #2 on: July 02, 2009, 11:19:18 AM »
have you try this?

http://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size

Yes! But thanks anyway for the reply!

In this wiki there is a «Note: these instructions are only applicable if you have a RAID system with more than one drive. They are not applicable to a single-drive RAID 1 system, and increasing the useable space on such a system by cloning the existing single drive to a larger drive is not supported. See http://bugs.contribs.org/show_bug.cgi?id=5311»

However, " a little bit of this and a bit a little of that" and... maybe I found a solution!

From http://forums.contribs.org/index.php/topic,34413.0.html I run:

Code: [Select]
[root@guru ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 8855.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (14-8855, default 14):
Using default value 14
Last cylinder or +size or +sizeM or +sizeK (14-8855, default 8855):
Using default value 8855

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

Then, from http://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size, I run:

Code: [Select]
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root

where in the last command above, the -C0 is: dash C zero

It seems to me that my problem is solved!

Can anyone test this procedure on another server?

If this work with other servers maybe we can make a new howto and give a solution to http://bugs.contribs.org/show_bug.cgi?id=5311.

Feedback will be appreciate.
Jorge Silva

Offline SuperGrover

  • **
  • 56
  • +0/-0
Re: Harddisk change
« Reply #3 on: January 20, 2010, 10:27:09 PM »
Hi Jorge,

I will try this myself tomorrow, but I don't understand your working procedure:

1. System with old drive
2. install new drive and sync via System admin ?
3. do the fdisk trick ?
4. reboot ????
5. the commands:
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root
6. shutdown and remove old drive?

hopefully you can help me, I'm struggling to get my 200Gb to work instead of the 80 Gb to get all my music via SqueezeCenter  :-P

Thanks

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Harddisk change
« Reply #4 on: January 20, 2010, 11:34:38 PM »
SuperGrover:

do you have atm a single 80GB hd?

do you want to replace it with a single 200GB or with a raid1 (a couple of 200GB)?

Offline SuperGrover

  • **
  • 56
  • +0/-0
Re: Harddisk change
« Reply #5 on: January 21, 2010, 10:11:58 AM »
I have a single 80Gb disk now, which I want to replace for a single 200Gb disk.

With Clonezilla I copied the 80 -> 200, but then the LVM only uses 80Gb of the 200Gb disk  :-(

Offline p-jones

  • *
  • 594
  • +0/-0
Re: Harddisk change
« Reply #6 on: January 21, 2010, 01:00:26 PM »
Quote
Can anyone test this procedure on another server?

It's been tested many times by many people. I have used it at least 6 times and IT JUST WORKS !
...

Offline SuperGrover

  • **
  • 56
  • +0/-0
Re: Harddisk change
« Reply #7 on: January 21, 2010, 01:54:27 PM »
Thanks for your answer!

Can you explain whether I have to reboot after the fdisk command on the new drive, or just continue without rebooting?

Offline p-jones

  • *
  • 594
  • +0/-0
Re: Harddisk change
« Reply #8 on: January 21, 2010, 09:22:50 PM »
Quote
from http://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size,

This is all you need to do. All the rest is making a lot of hard and unnecessary work.
...

Offline SuperGrover

  • **
  • 56
  • +0/-0
Re: Harddisk change
« Reply #9 on: January 21, 2010, 09:47:04 PM »
Unfortunately that instruction doesn't work, there's even listed why

Quote
These instructions should work for any raid level you have as long as you have >= 2 drives

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Harddisk change
« Reply #10 on: January 21, 2010, 10:36:42 PM »
Unfortunately that instruction doesn't work, there's even listed why

well.. did you try it?

Offline SuperGrover

  • **
  • 56
  • +0/-0
Re: Harddisk change
« Reply #11 on: January 21, 2010, 11:01:05 PM »
I did  :smile:

I'm trying again now, SME is now rebuilding the Raid on my newly formatted 200Gb disk  8)

Afterwards I will remove the 80Gb and follow jncs's instructions.....




Offline p-jones

  • *
  • 594
  • +0/-0
Re: Harddisk change
« Reply #12 on: January 22, 2010, 04:54:13 AM »
Quote
Afterwards I will remove the 80Gb

When  you started this thread, you had a 160Gb SATA Drive. Now it is an 80Gb Drive. Is the 80Gb SATA or PATA ?

I seem to recall having some minor issues switching between PATA & SATA
 
...

Offline SuperGrover

  • **
  • 56
  • +0/-0
Re: Harddisk change
« Reply #13 on: January 22, 2010, 08:01:52 PM »
When  you started this thread, you had a 160Gb SATA Drive. Now it is an 80Gb Drive. Is the 80Gb SATA or PATA ?

I seem to recall having some minor issues switching between PATA & SATA
ehm, I didn't not start the thread, that's jncs  ;)

Anyway, I will change a PATA for another PATA disk. Syncing is done, I will shutdown the server now and remove the 80 Gb and make the 200Gb as Primary Master.

Offline SuperGrover

  • **
  • 56
  • +0/-0
Re: Harddisk change
« Reply #14 on: February 01, 2010, 08:38:57 PM »
1. System with old drive
2. install new drive and sync via System admin ?
3. do the fdisk trick ?
4. reboot ????
5. the commands:
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root
6. shutdown and remove old drive?

hopefully you can help me, I'm struggling to get my 200Gb to work instead of the 80 Gb to get all my music via SqueezeCenter  :-P

Thanks
1. System with old drive
2. install new drive and sync via System admin
3. shutdown and remove old drive
3. boot up and do the fdisk trick by jcns
4. the commands:
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root
5. reboot and close your server casing again  :-P

I got it to work, thanks a lot for your help!

Finally I can get all my music on the server to stream over the SqueezeCenter!