need solution - to have both harddrives to have proxmox install and rsync data

rolypoly

Member
Jun 12, 2009
36
0
6
need solution - to have both harddrives to have proxmox install and rsync data from primary drive to 2nd drive eg. the data of VM and important settings.. i don't like to use RAID1 ... i tried to install proxmox on second drive but it say:
volume group pve already exists
and installation failed.. the purpose is when the primary drive fail, i can swap it with my second drive(with data being updated by rsync every hour or so..)
 
need solution - to have both harddrives to have proxmox install and rsync data from primary drive to 2nd drive eg. the data of VM and important settings.. i don't like to use RAID1 ... i tried to install proxmox on second drive but it say: and installation failed.. the purpose is when the primary drive fail, i can swap it with my second drive(with data being updated by rsync every hour or so..)

Forgive me, but isn't this sorta recreating the wheel here? Raid1 would do this for you easily, since it is sorta what it was designed for. But that's just me.

Try LVM mirroring. It's a raid1 option built in LVM. I've never used it, but this seems to give a rough walk through. Otherwise, i know of no way to have 2 LVM groups with the same name.
http://linoxide.com/linux-how-to/identify-linux-lvm-mirror/
 
Because with RAID1, every data written on primary drive will be repeated on second drive. This mean both drives gonna have the same I/O usage.. both drives gonna have issue in the time of drive failure since both have been running on same I/O usage constantly.. that is why i fear.
 
Because with RAID1, every data written on primary drive will be repeated on second drive. This mean both drives gonna have the same I/O usage.. both drives gonna have issue in the time of drive failure since both have been running on same I/O usage constantly.. that is why i fear.

Don't be afraid of raid. It works great. With RAID1 you will get data security + better read read performance.

If you need just simple spare disk with working system on it I can suggest to physically remove main disk and install Proxmox on to second disk.

Then you have to make sure each proxmox use own disk. I think you have choice of:
1) Filter /dev/sdX (second disk) from LVM scan. Edit /etc/lvm/lvm.conf change filter = [ "a|/dev/sdX|", "r|.*|" ] or better by UUID filter = [ "a|/dev/disk/by-id/dm-uuid-YOURDISK|", "r|.*|" ]
2) Rename LVM volumes and modify fstab (which is difficult)

Choose right boot disk in bios when boot.

PS: IMHO Having two disks for Proxmox boot is not really beneficial. if you keep Proxmox not highly customised you can always restore your infrastructure in minutes by downloading ISO and applying cluster configuration.
 
Last edited:
by using: Filter /dev/sdX (second disk) from LVM scan. Edit /etc/lvm/lvm.conf change filter = [ "a|/dev/sdX|", "r|.*|" ]

will it be enough to stop proxmox from detect the 2nd drive?


do i still need to modify/make changes to LVM volumes ? (i hope i don't have to..this sound complicated)

----------------------
to summaries again: the procedure is:
1. take out primary drive outside of server and install new proxmox on the 2nd drive
2. put back primary drive (meanwhile 2nd drive is outside of server) and modify /etc/lvm/lvm.conf . once done, slot back the 2nd drive together with 1st drive..

hopefully, there are other alternative and easier way to mirror drive.
 
Last edited:
by using: Filter /dev/sdX (second disk) from LVM scan. Edit /etc/lvm/lvm.conf change filter = [ "a|/dev/sdX|", "r|.*|" ]

will it be enough to stop proxmox from detect the 2nd drive?

Should be. It just standard LVM thing. UUID is better because in that case you never mix up your disks.

rolypoly said:
do i still need to modify/make changes to LVM volumes ? (i hope i don't have to..this sound complicated)
nope.

rolypoly said:
----------------------
to summaries again: the procedure is:
1. take out primary drive outside of server and install new proxmox on the 2nd drive
2. put back primary drive (meanwhile 2nd drive is outside of server) and modify /etc/lvm/lvm.conf . once done, slot back the 2nd drive together with 1st drive..
Yep. Just do filter LVM each other on both 1st and 2nd drives.

rolypoly said:
hopefully, there are other alternative and easier way to mirror drive.
This workaround is not for mirroring. It just one way to have dual boot.

PS: Hmm... I just realise what if you need to mount 2nd drive from 1st? If you filter drive globally you will not be able to do that.
PPS: If you need a simple mirroring - just use RAID1 for data but separate disks for root. Read and one of this guides:http://boffblog.wordpress.com/2013/08/22/how-to-install-proxmox-ve-3-0-on-software-raid/
 
I agree with both nerdyguy and daniel. RAID1 would be best choice for what you are trying to do. I dont think both HDDs having same I/O is even an issue. RAID1 will give you 100% redundancy while keeping things "as simple as it gets". With LVM mirroring you willl still have to dual boot the computer from the 2nd HDD and you just created extra work and overhead for you. Almost all newer motherboard has RAID1 function through BIOS.
 
if i would to rename the lvm on primary drive

from

/dev/pve/data
/dev/pve/root
/dev/pve/swap

to
/dev/pve2/data
/dev/pve2/root
etc

will proxmox still be able to recognise the new path?
 
Should be. It just standard LVM thing. UUID is better because in that case you never mix up your disks.


nope.


Yep. Just do filter LVM each other on both 1st and 2nd drives.

# blkid
/dev/sda2: UUID="9fee9ff2-3adb-4600-8400-18a1347987da" TYPE="ext3"
/dev/sda3: UUID="G1gTfz-nm0f-jUBj-dpex-bH2q-Y5IV-p7pqBx" TYPE="LVM2_member"
/dev/mapper/pve-root: UUID="1404ec6a-a201-455b-bc56-e0808a0f8aee" TYPE="ext3"
/dev/mapper/pve-swap: UUID="e196a913-c65d-4129-8524-7b86160a0054" TYPE="swap"
/dev/mapper/pve-data: UUID="f4807941-1e2f-462a-a682-8f1443eab1c4" TYPE="ext3"

or

# ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Aug 19 00:45 1404ec6a-a201-455b-bc56-e0808a0f8aee -> ../../dm-0
lrwxrwxrwx 1 root root 10 Aug 19 00:45 9fee9ff2-3adb-4600-8400-18a1347987da -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 19 00:45 e196a913-c65d-4129-8524-7b86160a0054 -> ../../dm-1
lrwxrwxrwx 1 root root 10 Aug 19 00:45 f4807941-1e2f-462a-a682-8f1443eab1c4 -> ../../dm-2



May i know which UUID should i use?

can you give an example for UUID filter = [ "a|/dev/disk/by-id/dm-uuid-YOURDISK|", "r|.*|" ] where i can input to my .conf file
 
I have follow the guide on setting up software RAID1..

got into some error .

Code:
# sfdisk -d /dev/sda | sfdisk -f /dev/sdb
Checking that no-one is using this disk right now ...

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util sfdisk doesn't support GPT. Use GNU Parted.

BLKRRPART: Device or resource busy

This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.

Disk /dev/sdb: 60801 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1          0+  60801-  60802- 488386583+  ee  GPT

care to shed some light on what is the next step i should do?
 
I have follow the guide on setting up software RAID1..

got into some error .

Code:
# sfdisk -d /dev/sda | sfdisk -f /dev/sdb
Checking that no-one is using this disk right now ...

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util sfdisk doesn't support GPT. Use GNU Parted.
care to shed some light on what is the next step i should do?[/QUOTE]

For GPT partitions you should use sgdisk:

[COLOR=#808080]sgdisk -R /dev/sdb /dev/sda ## copy partitions from sda to sbd[/COLOR]
[COLOR=#808080]sgdisk -G /dev/sdb ## assign new random UUID to the new disk

[COLOR=#808080]sgdisk --randomize-guids --move-second-header /dev/sdb[/COLOR] [/COLOR]
Check what you've got after all:

[COLOR=#808080]# parted -s /dev/sda print
[COLOR=#808080]# parted -s /dev/sdb print[/COLOR][/COLOR]
 
How about rename the volumegroup on the second drive from 'pve' to 'pve2' ..

this will not cause confilct and the system still can have both drive using the same file system without going through RAID1..

do you think it is possible?
 
How about rename the volumegroup on the second drive from 'pve' to 'pve2' ..

this will not cause confilct and the system still can have both drive using the same file system without going through RAID1..

do you think it is possible?

I am not quite experienced with LVM but the guides I found on Internet describing terrible things: basically to delete pv and re-create with brand new name.

Too hard mate.
 
You can rename the VG with vgrename, but you need to make sure nothing is using it and deactivate it before renaming. Best and easiest to do it from a rescue CD.

But from what you wrote I'd conclude you'd need RAID1. Everything else is just more complicated, especially for a beginner. The IO happening on the drives in parallel is not an issue. I'd suggest a solution that goes by the book (and coincidentally, it's the simplest and most robust): buy the cheapest hardware raid card you can afford (preferably with BBWC/FBWC) and set up RAID1. Then install PVE on top of it.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!