LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2012, 12:34 PM   #1
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Rep: Reputation: Disabled
Raid 1 to Raid 0


Hi everyone.
Am new in linux and i just purchase a dedicated server
2x 3 tb in raid 1.
as i know it should be raid 0 so i can use 6 tb to save files and raid 1 means mirroring like backup?
any tutorial step by step how can i do it?
or any old member can do tha for me?

thanks for any kind of help.

regards
 
Old 02-24-2012, 12:47 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
RAID 0 is dangerous and should only be used if you absolutely need the speed, and don't care if you lose everything on the entire array. I would highly recommend against it, especially with platter drives, and especially for a server.
 
Old 02-24-2012, 01:04 PM   #3
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
RAID 0 is dangerous and should only be used if you absolutely need the speed, and don't care if you lose everything on the entire array. I would highly recommend against it, especially with platter drives, and especially for a server.
thanks for your answer sir.
its just apache and ubuntu installed nothing else, so i have nothing to lose.
any tutorial?

Last edited by tejli007; 02-24-2012 at 01:06 PM.
 
Old 02-24-2012, 01:13 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Whether RAID 0 is a sane choice depends on the purpose of the server. The major aspect to consider is what would be the cost of loosing the entire contents of that file system. Even with RAID 0, the probability of loosing the filesystem is low. So if the cost would be only moderately high, low probability times moderately high cost equals acceptable risk.

If this were a transaction processing system (online sales, travel reservations, etc.) the cost of losing the file system may be absurdly high, so low probability is not good enough for "acceptable risk".

At the opposite extreme, I recently added a test server with RAID where I work (to offload some test runs from developer workstations). No data will ever be on the system that isn't easy to copy from elsewhere and/or recreate. So the "cost" of loosing all the data is just some time to put that data back. Meanwhile, that system must repeatedly write out an enormous amount of results very quickly, which results are later read back once, then deleted. RAID 0 is significantly faster than RAID 5 (and RAID 5 faster than RAID 1) for that access pattern. So RAID 0 would have a certainty of continuing time savings that would quickly add up to the time that might be lost by RAID 0 on an unlikely failure. So RAID 0 was the clear correct choice, which my employer's IT department would not let me select because everyone knows RAID 0 is not safe. So I have RAID 5, which cost more and is slower than RAID 0.

For the OP, we don't know enough to answer the "how to" question. What Linux distribution? Hardware RAID or software RAID or "fake" RAID (BIOS setup for software RAID pretending to be hardware RAID)?

If I understand correctly, it is a new server purchased with Linux already installed and RAID 1 already set up. Changing RAID 1 to RAID 0 would be VERY difficult without destroying all the contents. So if Linux is installed on that RAID 1, it would be best to wipe it all out and reinstall from scratch.

Quote:
Originally Posted by tejli007 View Post
just apache and ubuntu installed nothing else, so i have nothing to lose.
RAID 0 unsafe refers to ongoing use, not just to the process of switching to RAID 0. You plan to use that 6TB of space for something. Once you have filled that space, imagine it all getting wiped. If that would be difficult to deal with, maybe RAID 0 is OK. If that would be a horrible disaster, RAID 0 is not OK.

Quote:
Originally Posted by tejli007 View Post
any tutorial?
For switching from RAID 1 to RAID 0?
I can't imagine there would be.
Long ago, I switched a Dell fake RAID 1 to RAID 0 with Windows XP64 pre installed and I preserved the installed copy of XP64. Hard drives were more expensive then. I wouldn't waste my time nor take the risk for such a stunt now. Even then, I wouldn't do such a thing for Linux. I would dump the pre installed Linux if it were on RAID 1 (especially on fake RAID 1) and reinstall.

Last edited by johnsfine; 02-24-2012 at 01:26 PM.
 
1 members found this post helpful.
Old 02-24-2012, 01:26 PM   #5
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
Whether RAID 0 is a sane choice depends on the purpose of the server. The major aspect to consider is what would be the cost of loosing the entire contents of that file system. Even with RAID 0, the probability of loosing the filesystem is low. So if the cost would be only moderately high, low probability times moderately high cost equals acceptable risk.

If this were a transaction processing system (online sales, travel reservations, etc.) the cost of losing the file system may be absurdly high, so low probability is not good enough for "acceptable risk".

At the opposite extreme, I recently added a test system with RAID where I work. No data will ever be on the system that isn't easy to copy from elsewhere and/or recreate. So the "cost" of loosing all the data is just some time to put that data back. Meanwhile, that system must repeatedly write out an enormous amount of results very quickly, which results are later read back once, then deleted. RAID 0 is significantly faster than RAID 5 (and RAID 5 faster than RAID 1) for that access pattern. So RAID 0 would have a certainty of continuing time savings that would quickly add up to the time that one might be lost by RAID 0 on failure. So RAID 0 was the clear correct choice, which my employer's IT department would not let me select because everyone knows RAID 0 is not safe. So I have RAID 5, which cost more and is slower than RAID 0.

For the OP, we don't know enough to answer the "how to" question. What Linux distribution? Hardware RAID or software RAID or "fake" RAID (BIOS setup for software RAID pretending to be hardware RAID)?

If I understand correctly, it is a new server purchased with Linux already installed and RAID 1 already set up. Changing RAID 1 to RAID 0 would be VERY difficult without destroying all the contents. So if Linux is installed on that RAID 1, it would be best to wipe it all out and reinstall from scratch.


RAID 0 unsafe refers to ongoing use, not just to the process of switching to RAID 0. You plan to use that 6TB of space for something. Once you have filled that space, imagine it all getting wiped. If that would be difficult to deal with, maybe RAID 0 is OK. If that would be a horrible disaster, RAID 0 is not OK.
wow i could read all the day your message sir i enjoy it thanks.i will stay in raid 1 its safe.
but if the one disk space is broken, where can i find the second drive so i can copy the data again?

when i use df -f it shows just the space of 1 disk.

Filesystem Size Used Avail Use% Mounted on
/dev/md2 1016G 1.1G 964G 1% /
udev 7.9G 8.0K 7.9G 1% /dev
tmpfs 3.2G 296K 3.2G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 7.9G 0 7.9G 0% /run/shm
/dev/md3 1.7T 196M 1.6T 1% /home
/dev/md1 496M 42M 430M 9% /boot

where is the second disk?do thay ripped me?

2.
/dev/md2 1016G 1.1G 964G 1% /
/dev/md3 1.7T 196M 1.6T 1% /home

those 2 paritions are the biggest so if i install cpanel how many space i can use? 1.6 tb, 964 GB or all of that?
 
Old 02-24-2012, 01:39 PM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by tejli007 View Post
when i use df -f it shows just the space of 1 disk.
That is what RAID 1 is supposed to look like.

Quote:
where is the second disk?do thay ripped me?
Various other tools can show you the physical drives.

Quote:
but if the one disk space is broken, where can i find the second drive so i can copy the data again?
I'm not certain what RAID method you have from the info you posted. It looks like ordinary Linux software RAID, but I'm not sure.

I never was responsible for a Linux software RAID when hardware failed. So I don't know how you identify which physical drive failed. After you shutdown the system and replace the failed drive and start up again, I also don't know how you tell the RAID software that the new drive logically replaces the failed one. Once that is set up, a RAID 1 resynchronizes itself. You don't need to copy.
I'm sure Linux software RAID is well enough documented that all those procedural details could be found once needed.

Quote:
how many space i can use? 1.6 tb, 964 GB or all of that?
The way that was set up, you have 1.6TB of space you can use in sub directories of /home and an additional 964GB of space you can use for anything that is not in subdirectories of /home

I expect that is not a split you would have chosen for yourself. That is one of the problems of having an OS preinstalled vs. doing it yourself your way.

You could use symbolic links to put specific directories inside /home or outside /home (whichever has inappropriate free space) and use those directories in the opposite place (whichever has too little free space).

It also should be possible, booted from a bootable CD, to shrink one of md2 or md3 and grow the other. Alternately, delete md3 and grow md2 and make /home an ordinary directory rather than a partition. But I don't know the details well enough to describe. If I were doing it, I'd need to poke around a bit with partition display from a bootable CD before I'd be confident of what to do to grow a partition.

Quote:
if i install cpanel how many space i can use?
I don't know cpanel, so I can't address the cpanel specific part of that question.

Last edited by johnsfine; 02-24-2012 at 01:50 PM.
 
Old 02-24-2012, 01:55 PM   #7
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
That is what RAID 1 is supposed to look like.


Various other tools can show you the physical drives.



I'm not certain what RAID method you have from the info you posted. It looks like ordinary Linux software RAID, but I'm not sure.

I never was responsible for a Linux software RAID when hardware failed. So I don't know how you identify which physical drive failed. After you shutdown the system and replace the failed drive and start up again, I also don't know how you tell the RAID software that the new drive logically replaces the failed one. Once that is set up, a RAID 1 resynchronizes itself. You don't need to copy.
I'm sure Linux software RAID is well enough documented that all those procedural details could be found once needed.



The way that was set up, you have 1.6TB of space you can use in sub directories of /home and an additional 964GB of space you can use for anything that is not in subdirectories of /home

I expect that is not a split you would have chosen for yourself. That is one of the problems of having an OS preinstalled vs. doing it yourself your way.

You could use symbolic links to put specific directories inside /home or outside /home (whichever has inappropriate free space) and use those directories in the opposite place (whichever has too little free space).

It also should be possible, booted from a bootable CD, to shrink one of md2 or md3 and grow the other. Alternately, delete md3 and grow md2 and make /home an ordinary directory rather than a partition. But I don't know the details well enough to describe. If I were doing it, I'd need to poke around a bit with partition display from a bootable CD before I'd be confident of what to do to grow a partition.



I don't know cpanel, so I can't address the cpanel specific part of that question.


if i install cpanel in my md3 (1.6 TB) and when this drive is full the system will automaticly start to save in the other drive (md2 964 GB) or i should change it manually?or any option so i can delete one drive?

Last edited by tejli007; 02-24-2012 at 02:21 PM.
 
Old 02-24-2012, 02:09 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by johnsfine View Post
Whether RAID 0 is a sane choice depends on the purpose of the server. The major aspect to consider is what would be the cost of loosing the entire contents of that file system. Even with RAID 0, the probability of loosing the filesystem is low. So if the cost would be only moderately high, low probability times moderately high cost equals acceptable risk.

If this were a transaction processing system (online sales, travel reservations, etc.) the cost of losing the file system may be absurdly high, so low probability is not good enough for "acceptable risk".

At the opposite extreme, I recently added a test server with RAID where I work (to offload some test runs from developer workstations). No data will ever be on the system that isn't easy to copy from elsewhere and/or recreate. So the "cost" of loosing all the data is just some time to put that data back. Meanwhile, that system must repeatedly write out an enormous amount of results very quickly, which results are later read back once, then deleted. RAID 0 is significantly faster than RAID 5 (and RAID 5 faster than RAID 1) for that access pattern. So RAID 0 would have a certainty of continuing time savings that would quickly add up to the time that might be lost by RAID 0 on an unlikely failure. So RAID 0 was the clear correct choice, which my employer's IT department would not let me select because everyone knows RAID 0 is not safe. So I have RAID 5, which cost more and is slower than RAID 0.

For the OP, we don't know enough to answer the "how to" question. What Linux distribution? Hardware RAID or software RAID or "fake" RAID (BIOS setup for software RAID pretending to be hardware RAID)?

If I understand correctly, it is a new server purchased with Linux already installed and RAID 1 already set up. Changing RAID 1 to RAID 0 would be VERY difficult without destroying all the contents. So if Linux is installed on that RAID 1, it would be best to wipe it all out and reinstall from scratch.
Indeed, it all depends on the usage of the system. For a machine with high throughput and no critical data, like what you described of your system, RAID 0 is a perfectly acceptable choice. The problem comes when people simply go with RAID 0 because they want all of the space they paid for, and they like the convenience of having it all in one partition, without taking into account that they've now doubled the chance of losing data compared to a single drive, as well as doubled the amount of data they would lose in the event of a failure compared to a single drive (assuming both setups are at say 50% capacity at the time of failure).

I actively maintain 13 different machines with RAID (mixture of 1, 10, 5, and 6). Over the last 6 years, I've had probably...5-6 hard drive failures. Out of the total number of drives in the systems that's not terrible, but it's enough to warrant concern when dealing with an unprotected setup like RAID 0. It's all about the probability of failure (which will increase with time), and the value of the data that would be lost in the event of a failure (which, chances are, will increase with time, as the array fills up, the sources of the data found on the array disappear, and the manpower put into acquiring the data on the array rises).


Like johnsfine, I have no experience with migrating a RAID 1 to a RAID 0 without loss of data. I imagine it would be possible, but there's probably 1 way to do it right, and 100 ways to accidentally screw up and lose everything. If it's a fresh install, losing everything shouldn't be much of a concern, since I'm sure the system came with the necessary discs to re-install the OS and any necessary drivers.
 
Old 02-24-2012, 02:18 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by tejli007 View Post
if i install cpanel in my md3 (1.6 TB) and when this drive is full the system will automaticly to save in the other drice (md2 964 TB) or i should change it manually?or any option so i can delete one drive?
Chances are it would just fill the drive, and that would be that. It won't automatically switch over to another filesystem, unless there's some advanced logic built into cpanel.

"md" usually means it's a software or fake hardware/software RAID. True hardware RAIDs generally show up like normal discs (sda, sdb, etc), at least that's been my experience with 3ware/LSI and Adaptec. As johnsfine said, that's quite the odd split, 1TB to / and 2TB to /home? I wonder why they did that? You might be better off attempting to shrink md2 and grow md3, and if that fails you can always wipe, re-partition, and re-install from scratch.


mdadm is the Linux software RAID controller, and will tell you everything you need to know about your system.

Use "fdisk -l" to get a list of your devices, you should see your 3TB array somewhere in there, with md2 and md3 listed as partitions
Once you have the device name, use "mdadm --detail /dev/md" to get all of the info on the array, replacing /dev/md with your device name. You should see something like this for a RAID 1:

Code:
[root@Rigel ~]# mdadm --detail /dev/md126
/dev/md126:
      Container : /dev/md127, member 0
     Raid Level : raid1
     Array Size : 1465136128 (1397.26 GiB 1500.30 GB)
  Used Dev Size : 1465136260 (1397.26 GiB 1500.30 GB)
   Raid Devices : 2
  Total Devices : 2

          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0


           UUID : 6cfa7ea6:0c0f012b:063ec436:7130d3c4
    Number   Major   Minor   RaidDevice State
       1       8       16        0      active sync   /dev/sdb
       0       8       32        1      active sync   /dev/sdc

Last edited by suicidaleggroll; 02-24-2012 at 02:21 PM.
 
Old 02-24-2012, 02:22 PM   #10
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by suicidaleggroll View Post
I'm sure the system came with the necessary discs to re-install the OS and any necessary drivers.
Was that sarcastic?

I've never seen a system sold with Linux pre installed that also included the DVD or CDs needed to reinstall.
For systems purchased with Red Hat pre installed (and one year license prepaid), the people I work with have had no problem downloading and burning the Red Hat media in case reinstall is needed (I wasn't involved and don't know details of where they downloaded from).

For systems with Linux other than Red Hat pre installed, everyone I know downloads and installs a different distribution and makes no use of pre installed Linux, since working without reinstall media isn't safe and getting the right reinstall media can be harder than starting from scratch.

Quote:
Originally Posted by suicidaleggroll View Post
As johnsfine said, that's quite the odd split, 1TB to / and 2TB to /home?
I expressed no opinion on whether it was an odd split. My opinion was that whatever split was chosen during pre install would be unlikely to fit the specific needs of the actual user. Maybe 964GB to / and 1.6TB to /home is rather less like to fit some unspecified use than some other split might be.

If you don't understand why you need the split at all or you don't know how it should be split, splitting /home from / is more likely to cause problems than to avoid them. If it were my system, I'd figure out how to delete md3 and grow md2 and then all the free significant space would be in one pool for whatever needs that space.

Last edited by johnsfine; 02-24-2012 at 02:30 PM.
 
Old 02-24-2012, 02:26 PM   #11
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by johnsfine View Post
Was that sarcastic?
I generally build my machines and download/install the OS myself, so I don't have a lot of experience in that area. The few (very few) machines that I've bought with pre-installed Linux came with the discs. Probably depends on the manufacturer though, I just assumed that it was standard practice.
 
Old 02-24-2012, 03:30 PM   #12
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
I generally build my machines and download/install the OS myself, so I don't have a lot of experience in that area. The few (very few) machines that I've bought with pre-installed Linux came with the discs. Probably depends on the manufacturer though, I just assumed that it was standard practice.
How can i delete the second drive md2?
i want just to have one drive md3 with 3 tb.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Intro to Nested-RAID: RAID-01 and RAID-10 LXer Syndicated Linux News 0 01-08-2011 12:12 AM
Chosing a RAID for NAS: HW Raid, FRAID, SW Raid StefanAO Linux - Server 2 08-29-2009 11:43 PM
S.W RAID vs RAID accelerator (FastTrakR TX4310 ) @ RAID 1 David Zfira Linux - Newbie 6 07-29-2009 11:13 PM
LXer: Tutorial: Linux RAID Smackdown: Crush RAID 5 with RAID 10 LXer Syndicated Linux News 0 08-14-2008 11:20 PM
LXer: Linux RAID Smackdown: Crush RAID 5 with RAID 10 LXer Syndicated Linux News 0 02-26-2008 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration