Koozali.org: home of the SME Server

Noob help on replacing hard drive

Offline Trashman

  • *
  • 54
  • +0/-0
Noob help on replacing hard drive
« on: September 20, 2008, 06:54:25 PM »
Ok, i did a 100% copy with a hardware device (its not important atm what or how i reached this point) the thing is that i did a copy of my old 20gb ide hard drive into a 40gb and now i get:

[root@server ~]# df
S.ficheros         Bloques de 1K   Usado    Dispon Uso% Montado en
/dev/mapper/main-root
                      18416388   1922968  15557896  12% /
/dev/md1                101018     13267     82535  14% /boot
none                    160412         0    160412   0% /dev/shm

If i read it correctly it is just using 20gb of the disk, its still not a problem as you can see that the disk is barely used, but id like to be able to use the full disk, the system is starting correctly and all services and everything is in place, i dont have a single problem about the copy, its working atm but not seeing the whole disk...how can i enlarge that?

PS: the output its in spanish, but the gurus should understand it anyway...

PS2: sorry if this is a stupid question, im an extreme noob to linux and before flaming remember that we all where noobs once and "the only stupid question is the one not asked"...

PS3: ive been searching the forums for info on this specific matter but everything leads me to one or other backup-restore method...but here the data is already copied completelly, i dont need to start again with that part, i just want to increase the partition size
« Last Edit: September 20, 2008, 08:24:35 PM by Trashman »

Offline Trashman

  • *
  • 54
  • +0/-0
Re: Noob help on replacing hard drive
« Reply #1 on: September 20, 2008, 08:24:56 PM »
Do this still apply on 7.3?
http://forums.contribs.org/index.php?topic=34413.0
update, this ^^^ didnt worked, had to do again the copy :/ (sda2 => hda1 or hda2 didnt worked either)

More info, the upgrade info on the raid wiki doesnt work:

[root@server dev]# mdadm --grow /dev/md2 --size=max
[root@server dev]# pvresize /dev/md2
  Physical volume "/dev/md2" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized
[root@server dev]# lvresize -l +100%FREE main/root
  New size (572 extents) matches existing size (572 extents)
  Run `lvresize --help' for more information.
« Last Edit: September 20, 2008, 10:51:41 PM by Trashman »

Offline arne

  • *****
  • 1,116
  • +0/-4
Re: Noob help on replacing hard drive
« Reply #2 on: September 20, 2008, 10:59:25 PM »
Trashman -> But your link is for a virtual disk under vmware ?? (Or is it something I do not understand ?).

The very easy procedure to make a new and bigger installation is this:

1. Do a bacup to workstation of the old installation via server-manager.
2. Install the SME server to the new harddisk.
3. Make a bakup restore from workstation via the server-manager panel.

If the installation is not to heavy modified this will work 100 %.
 
......

Offline Trashman

  • *
  • 54
  • +0/-0
Re: Noob help on replacing hard drive
« Reply #3 on: September 20, 2008, 11:36:01 PM »
The procedure is for a virtual machine, but if you ommit the virtual machine part the rest is just a partition resizing procedure...it didnt worked anyway...

And my install is modified enough to make me avoid the backup-restore method...maybe in the future ill do a raid-copy method back and forth to the same drive if there is no other solution to this...

BTW...a raid copy is a simple procedure right? just to be sure it works like this:
- pop a second drive
- boot, go to admin and set it to be in the raid
- wait..more wait...
- when done turn off and replace disk leaving the 2nd one as primary
- turn on - everything is there as if nothing happened
all this without any more intervention than loging as admin and activating the raid right? (no CLI at all?)

On a sidenote i dont want or cant use other method moving the info than a 100% copy because my old disk start to have some bad sectors and i use an external hardware device that is good recovering those...that disk is not suitable anymore for a work environment, its flaky at best...
« Last Edit: September 20, 2008, 11:38:46 PM by Trashman »

Offline arne

  • *****
  • 1,116
  • +0/-4
Re: Noob help on replacing hard drive
« Reply #4 on: September 20, 2008, 11:47:05 PM »
There is something called Hirens boot CD that contains all kind of resizing tools etc (Partition magic among other). I think that is is not completely "clean" when it comes to licenses etc but it works quite well. Here it the link to the homepage:

http://www.hiren.info/pages/bootcd

I think some of the tools will require a valid lisence.
« Last Edit: September 20, 2008, 11:49:08 PM by arne »
......

Offline Trashman

  • *
  • 54
  • +0/-0
Re: Noob help on replacing hard drive
« Reply #5 on: September 20, 2008, 11:50:10 PM »
Yea i have the hiren bootcd (9.5) but for partition resizing what should i use? partition magic dont see anything at all in the drive, already tried...

Offline arne

  • *****
  • 1,116
  • +0/-4
Re: Noob help on replacing hard drive
« Reply #6 on: September 21, 2008, 12:03:55 AM »
But if the new hd is now running, it should only be to make a backup to workstation from this.

Then install sme once more and let it use all hd.

Then restore from workstation.

I have not tried this, but it might also work:
http://gparted.sourceforge.net/index.php
......

Offline Trashman

  • *
  • 54
  • +0/-0
Re: Noob help on replacing hard drive
« Reply #7 on: September 21, 2008, 12:09:54 AM »
Dont work either, booted my knoppix live cd...both gparted and qtparted see the structure but mark the main partition as unknown and cant resize it...maybe i need to learn how mdadm work...or eventually try the raid-copy method if it is easy...im it reseller so i often have spare hard disks around...

Can any1 confirm if the raid-copy thing is EASY to copy an entire disk? i mean, after i have both disks in raid i can remove one and the other stays working as if nothing happened?
« Last Edit: September 21, 2008, 12:17:30 AM by Trashman »

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Noob help on replacing hard drive
« Reply #8 on: September 21, 2008, 04:45:24 AM »
Trashman

Quote
...i did a 100% copy with a hardware device (its not important atm what or how i reached this point)

Perhaps the method you used has created some subtle difference on the drive compared to the original, and that's why the resize commands are not working correctly.


Quote
Can any1 confirm if the raid-copy thing is EASY to copy an entire disk? i mean, after i have both disks in raid i can remove one and the other stays working as if nothing happened?

Yes it should be, assuming your single disk is "correct" to start with.
What does
cat /proc/mdstat
now give?

You should always place a blank/empty disk into the array before resyncing it.
Use delpart.exe or similar to blank a disk first.

The commands here should work, if you follow them all carefully and correctly.
http://wiki.contribs.org/Raid

Remove the "rescued" disk you are now using, replace with another single disk for test purposes, then install sme, then try adding a second drive & rsync it with the console panel.
Then try running the resize commands from the wiki.
That will prove if your procedures are correct, and may also show there is a problem with the original disk.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Trashman

  • *
  • 54
  • +0/-0
Re: Noob help on replacing hard drive
« Reply #9 on: September 21, 2008, 03:29:31 PM »
The copy method is a forensic device called Solitaire Logicube so the most probable thing is that the copy is trully 100%...use the same device for wiping (DoD method) so it should be trully clean...

[root@server ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 hda2[0]
      19430528 blocks [2/1] [U_]

md1 : active raid1 hda1[0]
      104320 blocks [2/1] [U_]

Im trying now the raid-copy method back and forth, back with more info in a pair of hours.

« Last Edit: September 21, 2008, 03:33:19 PM by Trashman »

Offline Trashman

  • *
  • 54
  • +0/-0
Re: Noob help on replacing hard drive
« Reply #10 on: September 21, 2008, 08:09:50 PM »
Code: [Select]
[root@server ~]# mdadm --grow /dev/md2 --size=max
[root@server ~]# pvresize /dev/md2
  Physical volume "/dev/md2" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized
[root@server ~]# lvresize -l +100%FREE main/root
  Extending logical volume root to 36,53 GB
  Logical volume root successfully resized
[root@server ~]# ext2online -C0 /dev/main/root
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b
Added 4890624/4890624...
It worked, i also added a common sense:
Code: [Select]
[root@server ~]# signal-event rebootAnd tested with:
Code: [Select]
[root@server ~]# df
S.ficheros         Bloques de 1K   Usado    Dispon Uso% Montado en
/dev/mapper/main-root
                      37703192   1925060  33864724   6% /
/dev/md1                101018     13267     82535  14% /boot
none                    160412         0    160412   0% /dev/shm
[root@server ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 hda2[0]
      38965568 blocks [2/1] [U_]

md1 : active raid1 hda1[0]
      104320 blocks [2/1] [U_]

unused devices: <none>

The strange thing is that i wanst able to do that on the 100% disk, it does work on a raided disk, i guess that the raid doesnt do a 100% but a 99,9999% or so with the only difference being the size detected of the disk at the moment of the creation of the partition? im just guessing...anyway it is working perfect now and using the whole disk
« Last Edit: September 21, 2008, 08:12:52 PM by Trashman »