Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Can't Create LVM for Xen Virtualization !
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Can't Create LVM for Xen Virtualization !

Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran

Hi,

I need to create LVG for Xen Virtualization. I was following this tutorial: http://www.tecmint.com/create-lvm-storage-in-linux/

This is My fdisk result:

Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00059fdf

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1045     8388608+  fd  Linux raid autodetect
/dev/sdb2            1045        1110      524288+  fd  Linux raid autodetect
/dev/sdb3            1110      134785  1073741824+  fd  Linux raid autodetect
/dev/sdb4          134785      364802  1847607768    f  W95 Ext'd (LBA)
/dev/sdb5          134785      364802  1847605720+  fd  Linux raid autodetect

Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c2821

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1045     8388608+  fd  Linux raid autodetect
/dev/sda2            1045        1110      524288+  fd  Linux raid autodetect
/dev/sda3            1110      134785  1073741824+  fd  Linux raid autodetect
/dev/sda4          134785      364802  1847607768    f  W95 Ext'd (LBA)
/dev/sda5          134785      364802  1847605720+  fd  Linux raid autodetect

Disk /dev/md0: 8589 MB, 8589869056 bytes
2 heads, 4 sectors/track, 2097136 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/md1: 536 MB, 536805376 bytes
2 heads, 4 sectors/track, 131056 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/md3: 1891.9 GB, 1891948101632 bytes
2 heads, 4 sectors/track, 461901392 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe59000fa

    Device Boot      Start         End      Blocks   Id  System
/dev/md3p1               1   461901392  1847605566   8e  Linux LVM

Disk /dev/md2: 1099.5 GB, 1099511431168 bytes
2 heads, 4 sectors/track, 268435408 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

This is My df -h result:

Filesystem      Size  Used Avail Use% Mounted on
/dev/md2       1008G  1.2G  956G   1% /
tmpfs           7.4G     0  7.4G   0% /dev/shm
/dev/md1        496M   31M  440M   7% /boot
/dev/md3        1.7T   68M  1.7T   1% /home

If I want to create Physical Disk using pvcreate, it says:

[root@CentOS-66-32-minimal ~]# pvcreate /dev/md3p1
  Can't open /dev/md3p1 exclusively.  Mounted filesystem?

Can anyone help Me in solving this & create a LVG Successfully !!

Thanks in Advance.

Comments

  • Well you already have /dev/md3 mounted as home that is first problem.

  • Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran

    @aggressivenetworks said:
    Well you already have /dev/md3 mounted as home that is first problem.

    Then, I can't find any other Partition which isn't mounted and available free. Then, what to do !

  • edited February 2015

    With sw raid you already set the partitons like /dev/sda1 and /dev/sdb1 then you created a md device either raid1 or raid 0. So the md device can not be broken down anymore partitions unless you a VG group already established. Then you can create logical volumes (LV's). You have to use the whole md3 for a VG.

  • hetzner server? you should change partitions over installimage on rescue mode. it was easier

  • edited February 2015

    umount /dev/md3
    pvcreate /dev/md3
    vgcreate -s 32M VG_VZ /dev/md3
    lvcreate -L 50G -n home VG_VZ what ever size you want to make
    mkfs.ext4 /dev/mapper/VG_VZ/home

    Edit you /etc/fstab and change the /home info to reflect as the disk /dev/mapper/VG_VZ/home instead of /dev/md3

    reboot

    But this is a general workup of the commands you need to create a VG and still have /home directory. I might be wrong somewhere but this off the top of the head.

  • unmount /dev/md3

    Modify /etc/fstab & remove the /home entry, reboot & then do pvcreate & then vgcreate :)



    NOTE: Assuming that you don't need an extra partition for /home & enough space to use / for /home.

  • Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran

    @Jazzy8999 said:
    hetzner server? you should change partitions over installimage on rescue mode. it was easier

    I did this but now showing problem with MySQL.

Sign In or Register to comment.