Existing LVM filesystem to software RAID 0 (mirroring)
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Existing LVM filesystem to software RAID 0 (mirroring)
Hi there,
I am using FC6 with LVM for a while, and would like to use a software RAID 0(mirroring) with LVM to protect my disk. Could anyone suggest how to proceed for this changes?
I am using FC6 with LVM for a while, and would like to use a software RAID 0(mirroring) with LVM to protect my disk.
Firt of all, it's RAID 1. (RAID 0 is striping and won't give any redundancy).
Are you adding a new disk or are both disks already in use? If you are adding a new disk for the raid array, conversion on-the-fly is almost easy. Otherwise, it depends.
The new mirror you create must equal the size of your current LVM volume size.
Assuming VolGroup00 is your volume group.
Assuming /dev/sda is a 1 disk volume group part of your LVM.
Assuming /dev/sdb is your new disk your going to use as your mirror.
The new mirror you create must equal the size of your current LVM volume size.
Assuming VolGroup00 is your volume group.
Assuming /dev/sda is a 1 disk volume group part of your LVM.
Assuming /dev/sdb is your new disk your going to use as your mirror.
That should do it . Back up your data first. Assume no liability - etc.
Thanks to all for the suggestion.
Actually, I only have a IDE disk at my server, and would like to have some questions to ask:
1. If I install a new disk, does it need to be the same(model, capacity) to the existing one for RAID 1 support?
2. For the data backup, can anyone suggest or point to me how to do for this setup? I try to use Ghost 8.3 for disk cloning, but, it seem it cannot support on LVM partition.
1. No, the second mirrored disk must be equal or larger in capacity than your previous disk. They dont need to be the same model (on linux they dont even need to be using the same disk protocol). One could be IDE, one could be iSCSI. Providing the disk is equal or greater than your current setup thats all that would matter.
2. Use tar.
Since in unix everything is a file you can normally get away with a file by file backup routine - At recovery time you can reformat to ext3 / reiser, recover your data back onto your partition, add the pseudo directories (dev, sys, prc).
Finally just grub-install onto the disk again and your raring to go from where you left off.
The new mirror you create must equal the size of your current LVM volume size.
Assuming VolGroup00 is your volume group.
Assuming /dev/sda is a 1 disk volume group part of your LVM.
Assuming /dev/sdb is your new disk your going to use as your mirror.
That should do it . Back up your data first. Assume no liability - etc.
Today, I just have time to setup the RAID1 in my Linux. I have connected a 250G SATA disk and follow the instruction for doing the RAID on my LVM only.
The info. is as below:
1. VG name: rootvg
2. original disk volume group: /dev/hda2
3. new disk volume group: /dev/sda2
It seem all the steps have been finished without any error, and it seem the Linux functions are ok.
Thus, when I try to restart my Linux box, it seem it cannot find the new LVM partition at the boot time.
Code:
Logging initialised at Wed Apr 23 00:57:01 2008
Set umask to 0077
Using volume group(s) on command line
Finding volume group "rootvg"
Wiping cache of LVM-capable devices
Volume group "rootvg" not found
Wiping internal VG cache
Trying to resume from /dev/rootvg/swap00
Unable to access resume device (/dev/rootvg/swap00)
Creating root device.
Mounting root filesystem.
mount: could not find filesystems '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
Today, I just have time to setup the RAID1 in my Linux. I have connected a 250G SATA disk and follow the instruction for doing the RAID on my LVM only.
The info. is as below:
1. VG name: rootvg
2. original disk volume group: /dev/hda2
3. new disk volume group: /dev/sda2
It seem all the steps have been finished without any error, and it seem the Linux functions are ok.
Thus, when I try to restart my Linux box, it seem it cannot find the new LVM partition at the boot time.
Code:
Logging initialised at Wed Apr 23 00:57:01 2008
Set umask to 0077
Using volume group(s) on command line
Finding volume group "rootvg"
Wiping cache of LVM-capable devices
Volume group "rootvg" not found
Wiping internal VG cache
Trying to resume from /dev/rootvg/swap00
Unable to access resume device (/dev/rootvg/swap00)
Creating root device.
Mounting root filesystem.
mount: could not find filesystems '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
Could anyone suggest how to recover this issue?
Million thanks,
Exactly the same for me (mandriva 2009.1); but it doesn't happen if I extend the volume group with a physical disk or partition, only with raid devices.
Probably it is necessary to perform "vgcfgbackup" after vgextend; I haven't yet tried.
Let's make a deal: the first of us who finds the solution is requested to inform the other one, OK!
Alder
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.