LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-04-2004, 12:39 AM   #1
crayolarx
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Rep: Reputation: 0
Merging empty hard drive with root partion on ext3?


Is it possible to merge a hard drive with the root partition on ext3 in linux? Anyone know how?
 
Old 03-04-2004, 04:36 AM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
If you just want access to the drive then just make a directory /sparedrive and mount it there?

If you are wanting to use it as part of your / filesystem then you will need to mount it as /home, /usr, /tmp, /var or some other common directory.

Lets pretend the drive is /dev/hdaX
mkdir /sparedrive
mount /dev/hdaX /sparedrive
rsync -a /home/ /sparedrive/
umount /sparedrive
mount /dev/hdaX /home

Now edit /etc/fstab and add this line
/dev/hdaX /home ext3 defaults 0 2
 
Old 03-04-2004, 08:51 AM   #3
crayolarx
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
But then the hard drive space from the / root partition won't be avaliable in /home just the space from the hard drive I mounted will be. Maybe you can do this with a volume manager like LVM? But that only works on ext2 right?
 
Old 03-04-2004, 10:12 AM   #4
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
I think I know what you are saying. How about this?

Lets pretend the drive is /dev/hdaX
mkdir /sparedrive
mount /dev/hdaX /sparedrive
rsync -a /home/ /sparedrive/
umount /sparedrive
rm -rf /home #Free up the hard drive space
mkdir /home
mount /dev/hdaX /home

Now edit /etc/fstab and add this line
/dev/hdaX /home ext3 defaults 0 2
 
Old 03-04-2004, 02:12 PM   #5
crayolarx
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
basically its like this I have two 80 gig hard drives. One mounted the / and an empty one.
I want say /home to be 160 gigs instead of just mounting it and it being only 80 gigs. Or if the root directory was 160 gigs dont matter. If I did it your way I would have 80 gigs in /home and 80 gigs in / for the rest of the drive excluding the /home dir.
 
Old 03-04-2004, 08:29 PM   #6
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Sorry, I don't know of any way to do that.
 
Old 03-04-2004, 09:26 PM   #7
natalinasmpf
Member
 
Registered: Dec 2003
Distribution: Slackware 9.1
Posts: 309

Rep: Reputation: 30
Quote:
Originally posted by /bin/bash
I think I know what you are saying. How about this?

Lets pretend the drive is /dev/hdaX
mkdir /sparedrive
mount /dev/hdaX /sparedrive
rsync -a /home/ /sparedrive/
umount /sparedrive
rm -rf /home #Free up the hard drive space
mkdir /home
mount /dev/hdaX /home

Now edit /etc/fstab and add this line
/dev/hdaX /home ext3 defaults 0 2
That's so inefficient, just move the mount point somewhere else, say /oldhome/ and mount the device on /home/.

Its not possible to mount two separate loop/block devices on a single mount partition, btw! If they conflict, then what? That is how Linux was modelled after...

Oh, I would suggets reiserfs, btw, not ext2/ext3.
 
Old 03-05-2004, 03:29 AM   #8
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Usually when I post commands here I'm trying for clairity not efficiency. Unless someone asks "whats the most efficient way to do this?"

Do jou also go around and spell check everyones posts?
 
Old 03-06-2004, 08:51 AM   #9
natalinasmpf
Member
 
Registered: Dec 2003
Distribution: Slackware 9.1
Posts: 309

Rep: Reputation: 30
Its also more than effiency; you destroy files in the whole process.

The whole point is to demonstrate the flexibility of the mount system by the kernel...
 
Old 03-06-2004, 01:42 PM   #10
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Quote:
Its also more than effiency; you destroy files in the whole process.
I've been using rsync to backup partitions for a long time. So please tell me how that destroys files.


BTW crayolarx, I only suggested using the drive as /home to let you know of one way to utilize the drive. I would not suggest you use a 80G drive for /home. Typically in Linux you would split up the two drives between the common directories which if you planned it right would give you the same effect as having a 160G /.

There are many threads here explaining different partitioning schemes. Everybody has different needs and partitions differently.

One of my drives looks like this:
Code:
   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1      1274  10233373+   c  Win95 FAT32 (LBA)
/dev/hda2          1275      1401   1020127+  4d  QNX4.x
/dev/hda3          1402      1783   3068415   4f  QNX4.x 3rd part
/dev/hda4          1784      4998  25824487+   5  Extended
/dev/hda5          1784      2420   5116671   83  Linux /home
/dev/hda6          2421      3312   7164958+  83  Linux /usr
/dev/hda7          3313      3821   4088511   83  Linux /
/dev/hda8          3822      3948   1020096   83  Linux /var
/dev/hda9    *     3949      3998    401593+  83  Linux /boot
/dev/hda10         4249      4502   2040223+  83  Linux /Pictures
/dev/hda11         4503      4998   3984088+  83  Linux /Music
/dev/hda12         3999      4198   1606468+  83  Linux /build
/dev/hda13         4199      4248    401593+  83  Linux /tmp
 
Old 03-06-2004, 02:53 PM   #11
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
okay, let me see if i can understand this (because i have had the same question)

you have your root (/) partition, and next to it is an empty partition, correct?

you simply want to make one partition out of that?

well, the program i know that can do this is Partition Magic 8 for windows, and it's not free...
in PM, delete the unused partition and resize your root partition to take up that space

a program called qtparted for linux can do the same; is is a PM clone using linux native tools; make sure to read the Readme's and download the necessary external programs
http://qtparted.sourceforge.net/


another option (just though of it but is VERY dangerous); use fdisk to delete your unused partition and your current root partition; then create a new partition that starts in the exact same place as before and ends at the end of your unused partition; do this only as a last resort! backup before you even Consider this!
 
Old 03-06-2004, 03:29 PM   #12
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
The Logical Volume Management should be able to solve your problems. You can combine the size of both your hard disks and have it act as one. I have never tried it myself so I cannot comment on how hard or easy it might be. But it should suit your needs.


There is a tutorial here:
http://tldp.org/HOWTO/LVM-HOWTO/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you install ZipSlack on an empty FAT hard drive? EOHooligan Slackware 2 01-02-2005 05:32 AM
Getting new hard drive... Should I use ReiserFS or Ext3? jspenguin Linux - General 8 09-21-2004 08:02 PM
how do I safly partion my hard drive for windows ans Linux? Suijin Linux - Newbie 6 08-28-2003 03:07 PM
Mounting an ext3 hard drive harperonline Linux - Hardware 1 03-14-2003 04:27 AM
installing linux on an empty hard drive cestor Linux - General 5 05-28-2002 11:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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