Koozali.org: home of the SME Server

Migrating a SME7 from one disk to another [Raid/lvm needed]

Landry

Migrating a SME7 from one disk to another [Raid/lvm needed]
« on: March 02, 2006, 08:58:42 PM »
Hello all.

I'm a little newbie concerning raid/lvm setups. I'd like to migrate an existing fresh sme7 install (on an old NOISY hda 4Gb) to a silent hdc 120Gb, with important data on it. I can't directly install sme7 on the 120Gb, as the install takes all the disk.

I created hdc1 and hdc2 with mkfs.ext3, manually copied hda1 and hda2 on it, put the right fdisk type (FD for Raid Linux Autodetected) in the partition table for hdc1 and hdc2, and reinstalled grub on the mbr of hdc.

When i unplug the old hda, and put the hdc 120Gb in place of it, grub is okay, il boots the kernel, and after that it stop with error messages like :" md1 bad RAID superblock magic", " md2 bad RAID superblock magic", and then it doesn't manage to mount / => kernel panic. I think that my raid / md setup is bad, but i don't know how to handle this.

Does someone have a pointer to some help, or any idea for my planned setup ???
Thanks.

(I browsed docs and the forums, and didn't found any relevant info)

Offline ldkeen

  • *
  • 405
  • +0/-0
Migrating a SME7 from one disk to another [Raid/lvm needed]
« Reply #1 on: March 03, 2006, 12:22:09 AM »
Hi Landry,
This howto was written for 6.0.1 but you might glean some info from it regarding the "bad superblock" error.
http://no.longer.valid/phpwiki/index.php/Migrating%20a%20Raid%201%20to%20bigger%20harddisks%20with%20Knoppix
Regards Lloyd

Landry

Migrating a SME7 from one disk to another [Raid/lvm needed]
« Reply #2 on: March 03, 2006, 09:49:32 AM »
Thanks for the pointer..

Anyway, i've seen that SME7 didn't use /etc/raidtab, nor mkraid command.
The only available command is mdadm....
I'll try to mdadm --create the device md0 with my existing partitions. It is done this way in the install process (in sme7-cd/updates/raidconvert shell script).

I'll let the forum know if i manage to do this.
(It'll be sad to have to buy another disk just because of this little problem)

Landry

Offline FreakWent

  • ****
  • 89
  • +0/-0
moutning a second disk as slave
« Reply #3 on: March 31, 2006, 11:43:20 AM »
I can't really follow the instructions in the link given above, I think this is made harder than it has to be.  

Say we take the older (in my case 60Gb) drive, and the new 250Gb drive.

_My_ way would be to install the same version of sme on the latest drive to get sme-happy partitioning, then just mount the old drive and copy all the files across.  Why is this a bad thing?

Well with standard ext3 I never ever found this to be bad, but this LVM thing messes it all up.  The two volume names are the same, and every time I boot from the new drive, the system mounts the old drive as / !

I changed the lvm.conf to exclude hdb from the scan but it makes no difference.  I haven't worked with lvm before, and man lvm has no instructions on how to mount a different group.  I assume that if I unmount the current / then my system will be hard to use, do I have to boot from a CD to do this? Can someone please tell me how to mount an SME 7 disk in another SME 7 system? It used to be so easy...

Thanks for any replies, and I encourage all users to take a look at vtiger...

paul_sc

Migrating a SME7 from one disk to another [Raid/lvm needed]
« Reply #4 on: April 01, 2006, 01:29:31 AM »
Well, as far as mounting an existing lvm root drive into another sme 7 system I have no idea. In the past I would use acronis true image, to move to larger drives, but acronis does not support lvm last I checked.

I have had my own little roadblock with the new drive schemes.

I have 2 drives that I don't want mirrored, i want the lvm capacity. I have sme 7 installed on 1 drive. I believe I need to
connect the second drive
boot from a cd that has lvm support,
create the pv on the new drive,
add the new drive to the volume group,
unmount the primary volume,  
extend the file systems, and
remount the extended volumes.

I tried this last week with sme 7 rescue, boot cd, hold shift key, type text rescue, no network, but I got some error with only restart as an option. On a subsequent attempt while running in sme I some how unsync'ed the drives and caused a kernel panic.

I don't want to move the 'ibay' over to the new drive as was the traditional method with v6 because then I end up wasting about 150gigs on the root drive or spend time managing directories over the 2, or 3 drives over time as my space requirements change.

Being a green horn, I am just doing trial and error. If any one has some pointers on how to add the drive to the primary vg and make the root a linear lvm, I would be appreciative.

Offline FreakWent

  • ****
  • 89
  • +0/-0
Further investigations into SME7 transfer
« Reply #5 on: April 03, 2006, 03:05:29 AM »
OK well now I've got two drives with SME installed, one clean, one with my users, ibays etc.  Whichever you boot from, the slave drive's vg_primary is mounted as /

After a think, I decide that I would keep the boot partition on the big drive and use the 'proper' way to add the second to the RAID pool, then tell LVM that I wanted to remove the smaller drive, LVM would move the data for me and I should be all set.

So I trashed /dev/hdb2 (which was NTFS --it had been used for something else) and rebooted, all was fine, as per 'man pvcreate' I recreated /dev/hdb2 as partition type fd, then had to reboot to get that to take effect.

Sure enough, I got a kernel panic.  This seems to indicate that I can't even add another partition to the raid group, I never get the chance! The kernel dies as soon as it sees the fd-marked partition on hdb, claiming that it can't find vg_primary when it does the scan.

There must be someone around who knows how this is supposed to work and can help us out! I've logged a bug for this behaviour and was told that it won't be fixed and I shouldn't be messing around with raid like this anyway.

I'm stuck!  I can't find a howto or anything anywhere, I don't know what to do.

paul_sc

Migrating a SME7 from one disk to another [Raid/lvm needed]
« Reply #6 on: April 03, 2006, 06:50:11 AM »
Hi Freakwent....I made a new thread here:

http://forums.contribs.org/index.php?topic=31445.0

beacause what we are looking to do is a bit different than the main posters thread of migrating from a smaller drive to larger...would you post over to it and maybe someone will chime in.

Quote
I've logged a bug for this behaviour and was told that it won't be fixed and I shouldn't be messing around with raid like this anyway.


I was not aware 'we' should not be doing this, I need to go look at what you posted and what was said.

Thanks

Offline slords

  • *****
  • 235
  • +3/-0
Migrating a SME7 from one disk to another [Raid/lvm needed]
« Reply #7 on: April 03, 2006, 09:48:08 PM »
Be warned that playing with the setup can mess up your entire setup.  Also unless you are familiar with lvm on raid you might loose your redundancy by expanding your lvm.  With that said here are a few pointers to get you going.

- First partition your hard drive and set the type correctly (fd or 8e).
- If you want raid then create a raid device (mdadm).
- Note: This can be a degraded array if limited on drives.
- Create a physical volume (pvcreate) on the md device or partition.
- Extend the volume group (vgextend).
- Move logical volumes from one drive to another (pvmove).
- Note: If you are moving the logical volume that contains /usr and /lib then you will need to be in rescue mode (boot of CD).
- Remove old drive from volume group (vgreduce).
- Extend logical volume to take advantage of extra space (lvextend).
- Resize ext3 filesystem to take advantage of extra space (ext2online).

If you plan on removing the old drive be sure to also re-create and copy over the /boot partition.  This can not reside on a LVM.  It can reside on a raid device.  You will also have to install grub and initialize the bootloader correctly or system won't boot.

If you aren't familiar with these commands or aren't willing to risk your data playing with them then I'd advise against trying any of this.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs,
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." -- Rich Cook