The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-09-2009
ermeyers ermeyers is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
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)
Abbreviated:
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)
The first part of this problem is that lts2 server was setup with LVM on /dev/sda during install, and the lts1 server wasn't, so I need to emulate the LVM configuration of lts2 on lts1. So, first I need to move the standard install off of lts1:/dev/sda to /dev/sdd, so that I can begin a new LVM configuration on lts1:/dev/sda.

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
Were these links/nodes automatically created by "vgscan --mknodes"?

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
That's enough to start, I think.
  #2 (permalink)  
Old 4 Weeks Ago
icefalcon icefalcon is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 3
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..
  #3 (permalink)  
Old 4 Weeks Ago
ermeyers ermeyers is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
Thanks. I reinstalled.
Reply

Bookmarks

Tags
lvm2 raid1

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0