openSUSE Forums > Hardware » Help setting up LinuxRAID-1 in opensuse 11.1

Go Back   openSUSE Forums > Hardware
Forums FAQ Members List Search Today's Posts Mark Forums Read

Hardware Questions about drivers, peripheral cabling, configuration

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-Jul-2009, 09:03
Puzzled Penguin
 
Join Date: Jan 2009
Posts: 30
epsilon_da hasn't been rated much yet
Default Help setting up LinuxRAID-1 in opensuse 11.1

Hi people.

Current Circunstances:

I am currently using opensuse 11.1 in a desktop PC over a hdd of 160 Gb which is getting tiny.
I am happy with opensuse and i want to move the OS to another disk.
Also i will live in Germany in 2 Months and i cant ship me desktop with me, but there i will buy a good Laptop.

That is why buyed a new 750 Gb disk and before i go to G. i will sell my desktop with the 160Gb disk.

Now i want to copy the whole system to this bigger disk and in Germany copy all again to the laptop disk.

My system is partitioned in the next way:
boot ~ 200M
swap ~ 2G
LVM ~ 60G
LVM ~ 60G
root ~ 10G
home rest
in LVM there is only 1 lv of important data.

Because i have now 2 disks that i want to keep in sync, i need the next partition table to be using raid-1 and here is the problem.


I understand that raid-1 is mirroring and doesnt need or requires more than 1 disk to work, but i cant find a way to create the new disk with raid-1, and after being copyed all data, format the 160 Gb disk to be in the same raid.

To create the raid all tools requires 2 partitions to be added.
But i need to backup first and then add the second disk.

¿How can i make this to work without buying another disk?

thanks
Reply With Quote
  #2 (permalink)  
Old 05-Jul-2009, 09:32
BenderBendingRodriguez's Avatar
Wise Penguin
 
Join Date: Jun 2008
Posts: 1,585
BenderBendingRodriguez hasn't been rated much yet
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

To create ANY raid (using kernel's software RAID) you need to create two partitions and mark them as raid (it's the moment where you create a partition but instead formatting it you mark it as RAID) then of course go to RAID part of YaST partitioner and create a partition on that RAID-1. After that i propose You copy the relevant data to one of the disks that are part of that RAID-1 and the linux's kernel should take care of the rest.

It would be best to draw what you want to do
__________________
How does a linux geek make love??

- unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep;
Reply With Quote
  #3 (permalink)  
Old 05-Jul-2009, 09:57
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

This seems to be a common misconception about RAID1, that you can take an existing partition with a filesystem and data, pair it with an empty partition, brand them RAID1, then mirror the existing data, and voila, RAID1!

It doesn't work that way. RAID1 has to be created from the bottom up. First you label two empty partitions RAID and then assemble them. Then you format the array with a filesystem, ext3, xfs, what have you. As far as the filesystem is concerned it sees one virtual partition. Underneath, the kernel (or the RAID controller, in the case of hardware RAID) is keeping the components synchronised.
Reply With Quote
  #4 (permalink)  
Old 05-Jul-2009, 09:59
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

Quote:
Originally Posted by BenderBendingRodriguez View Post
You copy the relevant data to one of the disks that are part of that RAID-1 and the linux's kernel should take care of the rest.
Actually you just copy to the RAID device (md?) and the kernel does the rest. You don't mount the components separately.
Reply With Quote
  #5 (permalink)  
Old 05-Jul-2009, 10:07
BenderBendingRodriguez's Avatar
Wise Penguin
 
Join Date: Jun 2008
Posts: 1,585
BenderBendingRodriguez hasn't been rated much yet
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

I didn't say he can "rename" a partition as RAID and voila. I said to create two partitions marked as raid and that are part of a md RAID partition and THEN copy the data to to the partition that is part of this RAID 1 stripe.
__________________
How does a linux geek make love??

- unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep;
Reply With Quote
  #6 (permalink)  
Old 05-Jul-2009, 10:13
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

That post wasn't directed at you. But since you bring it up, RAID1 is mirroring, not striping. And you don't copy to the component partition, you just copy to the RAID1 array, as I wrote already.
Reply With Quote
  #7 (permalink)  
Old 05-Jul-2009, 10:18
Puzzled Penguin
 
Join Date: Jan 2009
Posts: 30
epsilon_da hasn't been rated much yet
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

no, i may have not choose the correct words to express my self. happens to me very oft in english.

i have:
sda = 160 Gb in current use, with normal partitioning
sdb = 750 Gb with future raid-1

i want to do is this:
- create raid1 with only sdb (no second disk)
- copy sda content to raid1 in whatever partition i choose
- configure grub on sdb and be able to boot with root in raid1.
- now i should have my data on raid1
- i can safelly delete data in sda
- Partition sda in someway that i can add it to raid1

At the end i would like to have a partition like 150 Gb of raid1 between sda and sdb, both able to boot alone.
A second partition in sdb with all the rest of data.

Then when i go to Germany, i can take only my 750 Gb disk and leave the computer working with only one 160 Gb disk.



Since my 750 Gb is lots of time bigger than 160Gb, i was thinking on first make duplicated partitions and add both partitions temporarilly to one raid, then remove one partition, add the 160Gb disk to raid1 and delete the duplicated partition creating a second raid1 with it.

I am reading some blogs about it and some says that i can do that.
create md0 with sdb1 and sdb2
copy data
remove sdb2 from md0
create md1 with only md2
and then rebuild md0 with sdb1 and sda1

But is this safe?
Wont the "rebuild" of md0 destroy my data on sdb1? What is the normal commands to add a new device to raid?

thanks
Reply With Quote
  #8 (permalink)  
Old 05-Jul-2009, 10:30
BenderBendingRodriguez's Avatar
Wise Penguin
 
Join Date: Jun 2008
Posts: 1,585
BenderBendingRodriguez hasn't been rated much yet
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

I'm not sure if removing one of the disk would work since (i may be wrong) the system would be complaining about missing disk? Wouldn't LVM be better for that?
__________________
How does a linux geek make love??

- unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep;
Reply With Quote
  #9 (permalink)  
Old 05-Jul-2009, 10:31
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,109
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

You have to backup the data somewhere else while you create the RAID because it involves a change of partition type and loss of the data in the current filesystem, ext3 I suppose.

Also it's not recommended procedure to run a RAID1 in degraded mode, which is what you propose to do when you remove sdb.

And booting is a separate issue. At boot time, GRUB knows nothing about RAID. So each disk must have its own bootloader. Lots of tricky issues there. Many people get around it by having a non-RAID /boot partition.

Why not just rsync the second disk to the first at regular intervals?
Reply With Quote
  #10 (permalink)  
Old 05-Jul-2009, 10:42
BenderBendingRodriguez's Avatar
Wise Penguin
 
Join Date: Jun 2008
Posts: 1,585
BenderBendingRodriguez hasn't been rated much yet
Default Re: Help setting up LinuxRAID-1 in opensuse 11.1

I guess your best option would be to use LVM mirroring. You will still need a separate /boot partition. Have a read here, hope it helps.

Chapter*7*Mirroring Data Using LVM
__________________
How does a linux geek make love??

- unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep;
Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks


Thread Tools
Display Modes

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




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2