how do I use an extra disk to expand the main partition which is 99% full.
Posts: 12
I have a small system with older small hard disks. The main one was 3.5G which was divided into the main, cache, and home. The main one is now full and I would like to connect my other small drive as part of the main partition. I have seen this type of connection at work but have not help do this type of setup.
I am a novice at working on this type of problem. I know linux as a user from prior work, but not as a administrator.
I have a system using SimplyMephis 6.

And/Or
Posts: 5513
If you want to add an additional drive and use it for one of the partitions, that is an option also. When you mention that "the main one" is 99% full, can you clarify which partition is full? Because you can use Adrian's advice to move things around and gain some space.
But if you then want to add an additional drive, you will need to partition it into a single, large partition, and probably use it for your new "home" partition.
Assuming that /dev/hda is currently used for all your stuff, and /dev/hdb is the new drive, once /dev/hdb has been partitioned to have one large partition at /dev/hdb1, you would then use the /mnt/hdb1 directory to temporarily mount and move your home stuff. To do that you must not be logged in as a regular user. You must not have anything actively changing in your current /home partition.
But if you log in as user root and open a konsole, you can mount /mnt/hdb1 (mount /dev/hdb1 /mnt/hdb1), then copy everything from /home to /mnt/hdb1:
# cd / # cp -a /home/* /mnt/hdb1
Once done, modify your /etc/fstab file so that "/home" is mounted to /dev/hdb1.
Make lots-o-backups.
You might also consider buying a SINGLE larger hard drive to replace the smaller one(s) that you have, if this is possible.
Jon
more questions.
Posts: 12
I think you need to:
1. copy /home content on CDs, or DVDs, or flashdrives, or external drive, etc
--trp So save it away.2. then remove the /home partition
--trp how is this done. Do I use QTParted.3. resize root partition (use QTParted)
--trp in drive A.
4. re-add /home content in /home on the root partition
--trp Is this on drive B or on the original drive A.5. change /etc/fstab by removing the /home mounting point
(also make sure the root partition has the same number as before, otherwise you need to edit /boot/grub/menu.lst too)
That should do it.
--trp
Can you explain more? Are you just making the home dir. smaller?
I would like to mount the other drive and move some portion of the system onto it. It is not mounting automatically.Thanks.
Tim Paige

Some Clarification
Posts: 5513
Tim, I'm sure Adrian will add his own information here, but I'll jump in too.
I think you are confused as to how your current system is set up, and how Adrian and I are recommending that you change things. According to your original description, you have three partitions: "main", "cache", and "home". By "main", I take you to mean the primary "root" system; by "cache", I take you to mean "swap", and "home" is, well, "home" (grin). I will assume from that, that this is your approximate hard drive layout:
/dev/hda1 mounted to / (root)
/dev/hda2 used as swap
/dev/hda3 mounted to /home
(It would be a good idea for you to post your current /etc/fstab file so that we can see what you really have.) Please perform the following commands, and post the results (do them as user root):
cat /etc/fstab # will show us all your mount points mount # will show us what's currently mounted swapon -s # will show us how your swap is being used df # will show us how full your partitions are
Where I think you are confused is mistaking "/home" as a directory versus "/home" as a mount point. See, you must first, always create "/home" as a directory in the root system. But the directory, in and of itself, has no "size" associated with it, other than the total potential size of the "partition" that root is on. But if you "mount" a partition to /home, then it will have whatever size of the new partition that has been "attached" (or grafted) onto root at that partition. A side effect of this is, if you already have "stuff" in /home, and you don't get rid of it, but you then "mount" a partition to /home, the original "stuff" is hidden and unavailable.
Adrian's idea is to simplify your structure by getting rid of a separate home "partition" and instead allowing it to take up part of the root system. Given that you only have a single, small hard drive, that would be the best thing to do.
Also, you have not been clear (to me anyway). Do you only have the one single 3.5 GB hard drive, or do you have other hard drive(s) that you want to use? Please be more specific as to what you think you want to do, then we can give you better direction. 
Jon

Quote:Adrian's idea is to
Posts: 4077
Adrian's idea is to simplify your structure by getting rid of a separate home "partition" and instead allowing it to take up part of the root system. Given that you only have a single, small hard drive, that would be the best thing to do.
Yep, that was my point, if you have a small HD it's better to have /home on your root partion, not on a separate one, if you have separate partitions you might end up running out of space on one and still having free space on the other -- that demands you to know in advance how much space you need for each which is not always possible. So, best choice in my opinion is to remove one partitions and extend the other (you need to back up all imporant data that you have)
--
Check out Mepis wiki: www.mepis.org/docs
Answer to the questions. more questions.
Posts: 12
Tim, I'm sure Adrian will add his own information here, but I'll jump in too.
*****
I will assume from that, that this is your approximate hard drive layout:
/dev/hda1 mounted to / (root)
/dev/hda2 used as swap
/dev/hda3 mounted to /home
>>> This is what it was before I tried to make your changes. Then I reloaded hda with only the hda1(/) and hda2(swap), with /home inside of hda1.
(It would be a good idea for you to post your current /etc/fstab file so that we can see what you really have.) Please perform the following commands, and post the results (do them as user root):
cat /etc/fstab # will show us all your mount points mount # will show us what's currently mounted swapon -s # will show us how your swap is being used df # will show us how full your partitions areWhere I think you are confused is mistaking "/home" as a directory versus "/home" as a mount point. See, you must first, always create "/home" as a directory in the root system. But the directory, in and of itself, has no "size" associated with it, other than the total potential size of the "partition" that root is on. But if you "mount" a partition to /home, then it will have whatever size of the new partition that has been "attached" (or grafted) onto root at that partition. A side effect of this is, if you already have "stuff" in /home, and you don't get rid of it, but you then "mount" a partition to /home, the original "stuff" is hidden and unavailable.
Adrian's idea is to simplify your structure by getting rid of a separate home "partition" and instead allowing it to take up part of the root system. Given that you only have a single, small hard drive, that would be the best thing to do.
Also, you have not been clear (to me anyway). Do you only have the one single 3.5 GB hard drive, or do you have other hard drive(s) that you want to use? Please be more specific as to what you think you want to do, then we can give you better direction.
Jon
Here is the results you asked for.
****
root@1[etc]# cat /etc/fstab
# Pluggable devices are handled by uDev, they are not in fstab
/dev/hda1 / ext3 defaults,noatime 1 1
/dev/hda2 swap swap sw,pri=1 0 0
none /proc proc defaults 0 0
none /proc/bus/usb usbfs devmode=0666 0 0
none /dev/pts devpts mode=0622 0 0
none /sys sysfs defaults 0 0
/dev/hdd1 /home ext3 noauto,users,exec 0 0
/dev/cdrom /media/cdrom iso9660,udf noauto,users,exec,ro 0 0
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 0 0
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 0 0
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 0 0
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 0 0
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 0 0
/dev/fd0 /media/floppy vfat,ext2 noauto,users,exec,rw 0 0
*****
root@1[etc]# mount
/dev/hda1 on / type ext3 (rw,noatime)
proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=100,mode=0622)
devshm on /dev/shm type tmpfs (rw)
capifs on /dev/capi type capifs (rw,mode=0666)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
****
root@1[etc]# swapon -s
Filename Type Size Used Priority
/dev/hda2 partition 265064 2876 1
******
root@1[etc]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 3826552 2587968 1044200 72% /
varrun 127644 136 127508 1% /var/run
varlock 127644 0 127644 0% /var/lock
udev 127644 76 127568 1% /dev
devshm 127644 0 127644 0% /dev/shm
****
I had to manually mount the other drive. It did not mount automatically. below is the list after mounting.
***
root@1[etc]# mount
/dev/hda1 on / type ext3 (rw,noatime)
proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=100,mode=0622)
devshm on /dev/shm type tmpfs (rw)
capifs on /dev/capi type capifs (rw,mode=0666)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/hdd1 on /home type ext3 (rw,nosuid,nodev)
***
root@1[etc]# swapon -s
Filename Type Size Used Priority
/dev/hda2 partition 265064 4256 1
*****
root@1[etc]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 3826552 2587976 1044192 72% /
varrun 127644 136 127508 1% /var/run
varlock 127644 0 127644 0% /var/lock
udev 127644 76 127568 1% /dev
devshm 127644 0 127644 0% /dev/shm
/dev/hdd1 1561604 33788 1448488 3% /home
**
More information:
Due to other problems I did reload the drive and then follow you changes. However, I was not sure I had the /etc/fstab set correctly to automatically mount the /dev/hdd1.
How do I do that?
Do I need to remove the noauto from command inside of fstab?
If I log in as ROOT and then change to /home will it set the correct mount point or is it the original /home inside of the /dev/hda1?
Tim Paige
more info
Posts: 12
Tim Paige
I umount /dev/hdd1 and looked at /home. It is the original
directory inside of /, because I had done a "touch test1" in it. I have one userid at trpaige. So there is a /home/trpaige.
Then I mounted the /dev/hdd1 and looked at /home. It had the newer data. The trpaige userid directory was located at
/home/home/trpaige.
I then rebooted and checked /home. It was the old one inside the / partition.
2 questions.
1) How do I change /etc/fstab line so /dev/hdd1 is auto
mounted?
2) How do I change that same line to get rid of the
extra "/home" in /home/home/trpaige.
It must also be in that line for /dev/hdd1 in /etc/fstab.
Thanks in advance for your help.
Mepis is a great product.
Tim Paige.

Welcome Back
Posts: 5513
Hey Tim, welcome back 
Thanks for the info. Here's what I see.
First, the reason that /dev/hdd1 is not being mounted automatically is because you have the option "noauto" in /etc/fstab. Save a copy of /etc/fstab (I always do) and then change the line with /dev/hdd1 and remove "noauto,users,exec" and replace with "defaults,noatime". Note, there are NO SPACES between the commas.
Next, the reason that your original "/home" (directory) is getting clobbered by your "/home" (mount) is that a mount always covers any information that exists in the directory. As you've seen, the old stuff is still there when "/home" is not mounted. Here's how to deal with that. All of this needs to be done as user root, and you should probably NOT BE LOGGED IN as a regular user. Why? Because we don't want you to have any part of "/home" (of whatever flavor) being used or locked. In the following example, "#" is the root prompt; don't enter it. Make these changes BEFORE you modify /etc/fstab
# cd / # go up to the root level # umount /home # if it was mounted; otherwise ignore # ls -lad /mnt/hdd1 # see if a temporary directory already exists # ### If you got a result that /mnt/hdd1 exists then ignore the following command # mkdir -p /mnt/hdd1 # make the new directory # mount /dev/hdd1 /mnt/hdd1 # mount "new home" to /mnt/hdd1 # ### time out...
I have a question for you. On your "new home" on /dev/hdd1, did you already create your user account and put stuff in it? If you did, then it's going to be difficult to copy things without possibly overwriting good stuff. I'm going to assume that you already have a directory called "trpaige" on /dev/hdd1 (not mounted). And I'm assuming that you have a directory "/home/trpaige". If so, I would recommend copying the old to a new place. What follows are the instructions for doing that:
# ### play ball! # cp -a /home/trpaige /mnt/hdd1/trpaige.old
Next, go over to your /mnt/hdd1/trpaige.old and look around and make sure that it looks like it has everything. You can do the following commands to compare:
# du -s /trpaige/* # du -s /mnt/hdd1/trpaige.old/*
If they look ok, then temporarily cover the original home up:
# cd / # make sure you're in root # umount /mnt/hdd1 # unmount the temp spot # mount /dev/hdd1 /home # take it for a spin # ls -la /home # you should see trpaige and trpaige.old
If the user id (uid) for trpaige is the same in both /home/trpaige and /home/trpaige.old then you should be able to see content in /home/trpaige.old via the command line as well as in konqueror. If so, then you can do all the copying/modifying/deleting as "you" and not root. Just copy stuff from /home/trpaige.old to /home/trpaige as needed (don't forget "hidden" files (the ones with leading ".")).
If all of the above is good, then you can get rid of your old stuff from the old "/home" directory. To do that you once again will have to log out as a regular user.
# cd / # umount /home # cd /home # you should see your old stuff # rm -r * # wave bye-bye! # cd /
Now you can modify /etc/fstab as above, and finally remount "/home" by simply entering "mount /home"
Does all of that make sense? Let me know how it goes 
Jon
Figured out the /home/home/userid
Posts: 12
Tim Paige
I figured out the reason for the /home/home/trpaige when I had the /dev/hdd1 mounted. Earlier I had copied the old home into the new drive at /mnt/hdd1/ to save it.
The second problem was I had not signed into the trpaige account the first time, so the setup scripts did not work with the new location. I unmounted the hdd1 and then signed into the trpaige the first time. I then logged off and and copied the old /home into my /root/savedir/home for later looking at.
Then I mounted the hdd1 back on and copied the /root/saved/home/trpaige into the new /home/trpaige location.
I then log on to the trpaige account and surprise it worked.
Until I had signed onto the account the first time it did like the new /home location.
I will try your changes in /etc/fstab. and let you know.
Thanks.
Tim Paige
I think you need to: 1. copy
Posts: 4077
I think you need to:
1. copy /home content on CDs, or DVDs, or flashdrives, or external drive, etc
2. then remove the /home partition
3. resize root partition (use QTParted)
4. re-add /home content in /home on the root partition
5. change /etc/fstab by removing the /home mounting point
(also make sure the root partition has the same number as before, otherwise you need to edit /boot/grub/menu.lst too)
That should do it.
--
Check out Mepis wiki: www.mepis.org/docs