LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Manual LVM2 config (http://www.linuxquestions.org/questions/linux-software-2/manual-lvm2-config-760867/)

ermeyers 10-09-2009 06:30 PM

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.

Doculus 10-09-2009 07:58 PM

Hi,
"dd" makes a sector-to-sector copy, but you should not have any of these partitions mounted.
You maybe you should go from a livecd.

Also, do not use them after together at the same time, as they will have the same filesystem uids, and this _can_ lead to problems (not sure about this, but I would avoid).

The dev/mapper links are automatically created, but not by vgscan --mknodes, but by the udev daemon, during the boot process.
(To be more explicit by vgchange -a y). You do not need to care about. You should not create static nodes for them either, as the device minor ids can change if you add/remove volumes, and you will have a mess.

For creating the logical volumes, you should go through pvcreate/vgcreate/lvcreate commands.
See the manual of them to understand them clearly, I do not want to mislead you.

Btw. I would suggest to setup a RAID10 array with the 4 disks, it purforms _much_ better.


All times are GMT -5. The time now is 11:29 PM.