![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No Manual Entry | salil2012 | Shell Programming and Scripting | 5 | 03-20-2009 12:54 PM |
| Need help with a manual task | jcalisi | Shell Programming and Scripting | 4 | 10-24-2008 04:26 PM |
| NDM manual | vinodhini4 | Shell Programming and Scripting | 1 | 08-30-2008 05:35 AM |
| Sun Solaris and LVM2 | jess_t03 | SUN Solaris | 3 | 02-14-2008 03:26 AM |
| No manual entry for | FattyLumpkin | UNIX for Dummies Questions & Answers | 3 | 03-25-2003 12:42 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Manual LVM2 config
I've got two Ubuntu 9.04 LTSP servers, lts1 and lts2, which have been setup differently by different people. Each server has 4+ scsi disks that I'd like to setup with LVM and SW_Raid-1 (for mirroring) on disks 0-3 on each.
Abbreviated: Code:
root@lts1:~# lshw -C disk
*-cdrom
...
*-disk:0
description: SCSI Disk
logical name: /dev/sda
size: 8683MiB (9105MB)
*-disk:1
description: SCSI Disk
logical name: /dev/sdb
size: 8683MiB (9105MB)
*-disk:2
description: SCSI Disk
logical name: /dev/sdc
size: 16GiB (18GB)
*-disk:3
description: SCSI Disk
logical name: /dev/sdd
size: 8683MiB (9105MB)
Code:
root@lts2:~# lshw -C disk
*-cdrom
...
*-disk:0
description: SCSI Disk
logical name: /dev/sda
size: 8683MiB (9105MB)
*-disk:1
description: SCSI Disk
logical name: /dev/sdb
size: 8683MiB (9105MB)
*-disk:2
description: SCSI Disk
logical name: /dev/sdc
size: 8683MiB (9105MB)
*-disk:3
description: SCSI Disk
logical name: /dev/sdd
size: 8683MiB (9105MB)
*-disk:4
description: SCSI Disk
logical name: /dev/sde
size: 16GiB (18GB)
Is "dd if=/dev/sda of=/dev/sdd" a sufficient copy? The LVM install on lts2 had created: Code:
root@lts2:~# ls -l /dev/lts2 total 0 lrwxrwxrwx 1 root root 21 2009-09-11 15:02 root -> /dev/mapper/lts2-root lrwxrwxrwx 1 root root 23 2009-09-11 15:02 swap_1 -> /dev/mapper/lts2-swap_1 I'd like to end up with the same for lts1: Code:
root@lts1:~# ls -l /dev/lts1 total 0 lrwxrwxrwx 1 root root 21 2009-09-11 15:02 root -> /dev/mapper/lts1-root lrwxrwxrwx 1 root root 23 2009-09-11 15:02 swap_1 -> /dev/mapper/lts1-swap_1 |
|
||||
|
re: manual lvm2 config
Don't get me wrong - what you are looking to do here is possible, however it involves a lot of mangling that may not be obvious at first. Honestly, if at all possible it is simpler to back up the data, wipe and re-install the system the way you want it to be. I've done this type of thing on Fedora based systems and it isn't pretty.
Besides just moving the data around, you'll have to reconfigure grub to find the new location of the root partition (it will be different inside an lvm) and you'll also have to create a new initrd file with LVM/RAID modules and information. Since the system wasn't installed with lvm & raid originally it won't have lvm & raid modules in the current initrd. You'll need to change the /etc/fstab file for all the filesystems to change them to LVM - though if you are careful to re-create the filesystem labels properly that may work ok for some of them (if they are using filesystem labels to recognize the FS at least) You will probably also need to boot the system from a rescue CD or liveCD to do the data-migration between disks. I don't know if you even CAN do a clean copy of sda if that is where your OS is running from. I would boot from a CD, create a filesystem on /dev/sdd, and use cpio to make cpio archives of the filesystems on /dev/sda, then wipe /dev/sda and create the LVM partitions/filesystems and use cpio to put the data back. Actually - if you're booting from a CD anyway, just swap sda and sdd. Saves you the time of copying all the data since you're just going to copy it back anyway. But be prepared to do a lot of mangling with grub and initrd files to be able to get the system to boot again. Oh - and I also noticed your disks are different sizes - don't forget that software RAID requires the raided partitions to be the same size. As I said at the start - it's probably simpler/faster to just back up the system and re-install it. Cheers, Anthony Last edited by icefalcon; 4 Weeks Ago at 10:03 AM.. |
![]() |
| Bookmarks |
| Tags |
| lvm2 raid1 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|