LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-27-2009, 03:30 PM   #1
ejbram
LQ Newbie
 
Registered: Jul 2007
Posts: 16

Rep: Reputation: 0
how to expand hard drive with new one


Hi,
I have a linux box that I'm using as a ADSL router (slack 12.1).
Until recently I had two hard drives in it, one for linux, and one for storing movies, music, etc.

It's like this:

/dev/hda2 3.7G 2.7G 799M 78% /
/dev/hda5 67G 29G 34G 47% /opt
/dev/sda1 917G 867G 3.5G 100% /opt/abram


So, I have just bought another 1,5 TB disk. My plan was to add it to the same mount location: /opt/abram to expand my storage disk, only to come to conclusion that this can't be done. OK, it actually makes sense, if I thought about it I would realise it before.

Anyway, what else can I do? Is there a way to add new drive to existing one in a way that would result in one 2,5 TB drive?

I tried it with mdadm, but as it turns out, it's impossible to crate RAID 0 without loosing all the data on sda1 disc.
Also, it would be very cool if I could find a solution that would enable me to one day add a new drive to further expend my storage.

I'm aware that I could mount my new disk to, let's say /opt/abram/Divx, or /opt/abram/mp3, but that's not the solution I'm looking for.


Thanks.
 
Old 10-27-2009, 04:04 PM   #2
SethsdadtheLinuxer
Member
 
Registered: Jun 2007
Posts: 152

Rep: Reputation: 37
google "stripe raid array" and hopefully you will find an answer.
 
Old 10-27-2009, 04:15 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Don't think RAID is where you want to be going, especially as your two volumes are different sizes.

Do you really want 2.5Tb with *NO* redundancy? That could be a hell of a lot of data to lose. Either way, what you want to be doing is doing it with LVM. As the new drive is larger than the old partition, you're in a great position to do this safely. Just create a new LVM partition on the drive, filling it up, create a Physical Volume and then a nice Logical Volume inside it, and format it. Then just copy all data into the newly mounted partition. Once it's there, you can happily nuke the old partition, LVM that up too, and add it to the existing PV and then the same LV, making a final 2.5Tb volume. Bosh. Job done.
 
Old 10-27-2009, 04:28 PM   #4
ejbram
LQ Newbie
 
Registered: Jul 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Don't think RAID is where you want to be going, especially as your two volumes are different sizes.

Do you really want 2.5Tb with *NO* redundancy? That could be a hell of a lot of data to lose. Either way, what you want to be doing is doing it with LVM.
Well, the data is not that sensitive, it's a disk that a few of us on LAN use it for movies, music, games and stuff we download from the net.

LVM? I don't really know how to use that, but thanks a lot for the reply. I'll google it and hopefully find a solution. If you have
a link for a good tutorial about this, please post a link.

Thanks!
 
Old 10-27-2009, 04:32 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
http://tldp.org/HOWTO/LVM-HOWTO/

you'll actually be using the newer LVM2, not LVM1... but anyway, easy enough. Slack probably contains some form of gui to do it too, maybe gparted?
 
Old 10-28-2009, 11:30 AM   #6
ejbram
LQ Newbie
 
Registered: Jul 2007
Posts: 16

Original Poster
Rep: Reputation: 0
Well, I did it.

I used LVM. First I created a new volume group and added
the new 1,5 TB disk to it. Then I created a logical volume
form that disk, copied all the files from the old 1 TB disk,
added it to the same volume group (which erased the disk)
and then expanded the logical volume to include both disks.

The final result looks like this:
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 3.7G 2.8G 794M 78% /
/dev/hda5 67G 32G 31G 52% /opt
/dev/mapper/abram_vg-abram_disk 2.3T 868G 1.4T 38% /opt/abram

So the next time I buy a new disk, it should be no problem to
add it to the same group and extend my logical volume.

Also, as far as I could find out, it's no problem to transfer this groups of disks to another system, for example if I reinstall
linux, maybe updating my slackware.
 
  


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
Moving files from a Linux hard drive to a Windows Vista Premium hard drive WolfMan51 Linux - Hardware 5 07-12-2011 09:19 AM
[SOLVED] Hardware crash,Repaired,New Install New Hard drive,how to access original Hard drive flatstan Linux - Hardware 7 07-21-2009 06:51 PM
How to expand the OS drive when I have no room left? datatoo SUSE / openSUSE 1 05-30-2009 01:57 AM
Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 dcorb62 Linux - General 7 09-04-2007 11:28 PM
expand main partition to another hard drive? halo14 Red Hat 3 08-09-2004 04:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:19 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