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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-04-2004, 12:39 AM
|
#1
|
LQ Newbie
Registered: Mar 2004
Posts: 6
Rep:
|
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?
|
|
|
03-04-2004, 04:36 AM
|
#2
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
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
|
|
|
03-04-2004, 08:51 AM
|
#3
|
LQ Newbie
Registered: Mar 2004
Posts: 6
Original Poster
Rep:
|
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?
|
|
|
03-04-2004, 10:12 AM
|
#4
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
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
|
|
|
03-04-2004, 02:12 PM
|
#5
|
LQ Newbie
Registered: Mar 2004
Posts: 6
Original Poster
Rep:
|
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.
|
|
|
03-04-2004, 08:29 PM
|
#6
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
Sorry, I don't know of any way to do that.
|
|
|
03-04-2004, 09:26 PM
|
#7
|
Member
Registered: Dec 2003
Distribution: Slackware 9.1
Posts: 309
Rep:
|
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. 
|
|
|
03-05-2004, 03:29 AM
|
#8
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
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?
|
|
|
03-06-2004, 08:51 AM
|
#9
|
Member
Registered: Dec 2003
Distribution: Slackware 9.1
Posts: 309
Rep:
|
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...
|
|
|
03-06-2004, 01:42 PM
|
#10
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
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
|
|
|
03-06-2004, 02:53 PM
|
#11
|
Member
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987
Rep:
|
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!
|
|
|
03-06-2004, 03:29 PM
|
#12
|
Member
Registered: Feb 2004
Posts: 467
Rep:
|
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/
|
|
|
All times are GMT -5. The time now is 03:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|