LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-24-2015, 05:58 PM   #1
Machtri
LQ Newbie
 
Registered: Nov 2015
Posts: 1

Rep: Reputation: Disabled
Using two hard drives as one


I'm running the latest version of Ubuntu and I'm determined to have more memory storage for a potential gaming PC. I have a second hard drive I would like to "merge" (I don't know what to call it) with the first. I've looked up LVM (Logical Volume Manager) but it doesn't provide any clear instructions for exactly what to do. In summary, I wish to hook up my second hard drive along with the first and have the two recognized as one.

Last edited by Machtri; 11-29-2015 at 11:03 AM.
 
Old 11-24-2015, 06:42 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Try looking at the MD raid 0.

https://raid.wiki.kernel.org/index.php/Linux_Raid

I can't recommend using btrfs (I've had kernel faults from raid1 and raid5, along with some loss of data), though raid 1 with btrfs works most of the time (don't mount another drive on a btrfs filesystem and export it via NFS...)
 
Old 11-24-2015, 10:57 PM   #3
sidzen
Member
 
Registered: Feb 2014
Location: GMT-7
Distribution: Slackware64, xenialpup64, Slacko5.7
Posts: 204

Rep: Reputation: 36
Unfortunately, I've yet to hear of anyone having much success with a RAID setup using Linux. Identical disks with identical firmware on them is recommended (or was, in the old SCSI days). Striping or RAID-0 was for performance, while mirroring or RAID-1 was for data redundancy. Ideally, four identical disks were needed, in one striped pair mirrored to the other striped pair.

For a newbie, maybe you are taking on something impractical. Perhaps your best bet is to max out the RAM for your machine with matched low latency sticks on a motheroard that allows for dual-channel.

Last edited by sidzen; 11-24-2015 at 10:58 PM.
 
Old 11-24-2015, 11:13 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by Machtri View Post
In summary, I wish to hook up my second hard drive along with the fourth and have the two recognized as one.
Are these currently unused drives ?.
If so, contrary to the two members above, this looks like exactly what LVM was designed for. No need for similar sizes, can be expanded simply later in need to add more drives.
Personally I would (and do) use btrfs for things like this, but also wouldn't recommend it to someone not used to the environment.
 
Old 11-24-2015, 11:57 PM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by sidzen View Post
Unfortunately, I've yet to hear of anyone having much success with a RAID setup using Linux. Identical disks with identical firmware on them is recommended (or was, in the old SCSI days). Striping or RAID-0 was for performance, while mirroring or RAID-1 was for data redundancy. Ideally, four identical disks were needed, in one striped pair mirrored to the other striped pair.
Hear from me then. I have four drives, SATA not SCSI, three of them 3TB, one 2TB. Four 2TB partitions, RAID 5. Works.
Quote:
Originally Posted by sidzen View Post
For a newbie, maybe you are taking on something impractical.
That is probably true. mdadm is not that easy to use.

And:
Quote:
Originally Posted by syg00 View Post
Are these currently unused drives ?.
If so, contrary to the two members above, this looks like exactly what LVM was designed for. No need for similar sizes, can be expanded simply later in need to add more drives.
Personally I would (and do) use btrfs for things like this, but also wouldn't recommend it to someone not used to the environment.
Yes, this is what LVM is for. However, a combination of two disks is more likely to fail than a single disk, so that your filesystem is also more likely to fail.

Last edited by berndbausch; 11-25-2015 at 12:05 AM.
 
Old 11-25-2015, 01:54 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If the 1st drive is already used (& I suspect it is), you can simply create a mnt point somewhere on it and attach the 2nd drive there.

Note that LVM'ing 2 drives makes one big one, but if either one dies, you lose ALL the data on both (because its one FS).
Ensure you have up to date backups!
 
Old 11-25-2015, 02:02 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
That is not a limitation only of LVM. RAID (of any form) provides no protection for many things - like "rm -rf ..." as a simple example.

Everybody needs good backups.
 
Old 11-25-2015, 05:55 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by sidzen View Post
Unfortunately, I've yet to hear of anyone having much success with a RAID setup using Linux. Identical disks with identical firmware on them is recommended (or was, in the old SCSI days). Striping or RAID-0 was for performance, while mirroring or RAID-1 was for data redundancy. Ideally, four identical disks were needed, in one striped pair mirrored to the other striped pair.
Raid 0 with linear organization doesn't care about sizes. It just concatenates one drive onto the end of the other, and can be used to concatenate more than two drives.

Raid 1 does require matching drives as that is attempting to mirror the actions of one drive onto another. Mirroring can be done with more than two drives, but is inefficient when done as it wastes a drive.

Raid 5 needs at least three drives of the same size to provide storage space of two drives. The space of the third is used for recovery if a drive fails.

NOTE - "drive" does not necessarily mean physical drive. It is sufficient to have a partition that is the same size. The directions for setting up a raid 1 (or 5) recommend creating a partition of nearly the entire drive. This allows for variations in the size of disks (not all 3TB disks are the same, there will be varying number of bad spots and such). The left over space itself can STILL be used - by partitions composing a raid 0, or just used by themselves.
Quote:
For a newbie, maybe you are taking on something impractical. Perhaps your best bet is to max out the RAM for your machine with matched low latency sticks on a motheroard that allows for dual-channel.
This can be counted as a learning experience.

It is how I've used this, and tested it - and why I don't recommend btrfs, which has some really nice features - faster, more flexible, simple setup. BUT btrfs raid 5 (or raid 1) can lose your data when/if a partition gets damaged (I zeroed one for tests). Turns out it can't detect that particular failure... and the system gets kernel faults that freeze the system. The recovery tools didn't work either... Same test with md raid 5 (and raid 1) - during the failure, yes it didn't work (I/O errors) - but no kernel faults, and recovery worked (just flaw the zapped partition). The disadvantage was requiring manual intervention, the advantage was the system remained stable allowing recovery.

Last edited by jpollard; 11-25-2015 at 05:57 AM.
 
Old 11-25-2015, 06:03 PM   #9
mothergoose729
Member
 
Registered: Aug 2008
Distribution: Ubuntu x64
Posts: 118

Rep: Reputation: 19
For your application you want JBOD ("just a bunch of disks").

Most onboard raid controller support it. Getting the proper drivers for linux installed and working might be a chore - consult your motherboard manufacturer.
 
Old 11-25-2015, 08:16 PM   #10
Fred Caro
Senior Member
 
Registered: May 2007
Posts: 1,007

Rep: Reputation: 167Reputation: 167
Machtri,

you have 4 disks? or two disks and 4 partitions?
LVM will create a "virtual" partition of whatever and provide striping ( the increased speed) but then so will raid.
Both will increase stress to the hardware.
If you just need more space then raid0 or LVM with striping. Not sure if you can have the /boot directory in raid0.

Fred.
 
Old 11-25-2015, 08:53 PM   #11
sidzen
Member
 
Registered: Feb 2014
Location: GMT-7
Distribution: Slackware64, xenialpup64, Slacko5.7
Posts: 204

Rep: Reputation: 36
Thank you, gentlemen, for clarificaion on RAID setups and LVM. This is for what the forums are designed!
Now, it would be nice to hear back from the OP . . .
 
Old 11-25-2015, 11:02 PM   #12
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Fred Caro View Post
Machtri,

you have 4 disks? or two disks and 4 partitions?
LVM will create a "virtual" partition of whatever and provide striping ( the increased speed) but then so will raid.
Both will increase stress to the hardware.
If you just need more space then raid0 or LVM with striping. Not sure if you can have the /boot directory in raid0.

Fred.
MOST systems use an initrd to identify all raid devices. Before that, it is up to the bios/EFI as to whether it will use it. For a raid 0 you don't usually use /boot for that (raid 1 mirroring is better) due to the small size of /boot (less than 1 GB). The advantage is that since it is mirrored one partition alone is actually used by the BIOS to load from - and that shouldn't matter whether it is raid 1 or not. Raid 0 would give problems due to the fact that a load file could span the two partitions - and the BIOS is unlikely to do that.
 
Old 11-26-2015, 07:26 PM   #13
Fred Caro
Senior Member
 
Registered: May 2007
Posts: 1,007

Rep: Reputation: 167Reputation: 167
I wonder what the original poster makes of this discussion but up to them to post.

ipollard,
so, are you saying it is better to put /boot on its own partition on the first drive and not raided?

Fred.
 
Old 11-26-2015, 09:04 PM   #14
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I'm saying it is up to the BIOS as to what you can do. It has to load grub from that disk... Most BIOS can/should handle reading from a specific disk - even if that disk is part of a mirror (raid 1).

As long as it can load that, you should be good to go. Grub2 does know some raid features - it is very nearly a kernel on its own.

Pesonally, I like having two partitions for boot (separate copy). That way if something happens to one - you can direct the BIOS to the other and still get the system up. It does mean that there is some additional work to maintain both copies - but it provides a live backup in case something happens (like accidental deletes).

/boot is small enough that having multiple independent copies is not a hardship even if it isn't raided.
 
  


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
tape drives vs hard drives(long term data retention) wstewart90 Linux - Enterprise 12 05-26-2015 03:48 PM
2 hard drives, XP on my main sata drives, 10.2 on my IDE LILO doesnt show on boot up Dachy Slackware 14 01-03-2008 07:01 AM
Hard Drive Partitioning for Large Hard Drives Matir Linux - General 2 12-26-2006 05:55 AM
External Hard Drives/Hard Drives ddrfreak Mandriva 1 12-16-2004 06:12 PM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM

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

All times are GMT -5. The time now is 09:51 PM.

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