Is it this simple to add more hd space?
Hi
I seem to be running out of space on my hd, and i'm sorta unsure about how to work my way around the problem. I have 2 hd's with lotta partitions: 1st hd has swap, mount point /, mount point /home, + 2 fat partitions (for file storage). 2nd hd has 2 nt partitions (i dualboot linux/win2000). I've installed lotta progs on / and since i keep the source in /usr/local/src, the partition is full. I realise that i was too generous to /home. What i plan to do is this: Free up 1 (or both) fat partitions, convert it to ext3 and edit fstab so it will be mounted at /usr. Is it that simple? Should i move the content of the existing /usr to the new partition before i mount it? Or will this wreck the system? |
I think you have the right idea:
Free up FAT partition(s), make a linux filesystem (ext3 if you like) there. Mount the new (empty) partition at /mnt/newpart To keep things from changing while you are copying, go to single user mode. Copy [I would not recommend 'move'] over EVERYTHING from /usr to /mnt/newpart. You might like to search LQ for how to do this reliably, keeping permissions etc. The last time I did this, I did it like this: Code:
#cd /usr Check that everything has been copied over correctly. Now you can delete all of /usr. Take great care with this as youl'll be doing a rm -Rf as root!! Now unmount your partition from /mnt/newpart, and mount it at /usr. Now you can safely leave single user mode Don't forget to edit fstab to reflect the fact that your new partition has to be mounted at /usr, or you may not survive a reboot. Hope this helps. |
Thanx a lot, that was very helpful :)
|
Mission: success :)
Now, this worked great! I've just added a lot more space...
I just wonder: Can i use this method to move the entire os to another (bigger) hd ?? Guess that's wishful thinking, but i really don't wanna install everything all over again (if i can avoid it). How can i do this? Code:
phr0zen9uy@phz01:~$ df |
We need to know what is currently being mounted where, and where the free space is on hdb.
So could you post the contents of /etc/fstab and the output of fdisk -l /dev/hdb (hope that is the right command, I'm at work now and using that other OS) |
I recently moved my OS to a bigger drive. I moved home first in root with cp -a but then I moved the / root partition using a knoppix bootable cd (still using cp -a) - Keep the original as you will need it.
Once copied across you have to edit the fstab on the new partition, then rig lilo on the original OS so you boot the new OS partition. Once you're booted you can edit and run lilo so you can boot the new partition. There are a couple of ways to do all this, and you can make an emergancy rescue cd if you are worried, but it does work. Once the new part is up and running a while and you are sure all is well, you can then reclaim all the old space :) |
Thanks for the help tredegar. Your tip on how to solve my former "problem" worked great. Anyway, here's the info you wanted:
Code:
phr0zen9uy@phz01:~$ cat /etc/fstab
As you can see from my fstab; to do this i have removed the original /dev/hdd which had two ntfs partitions (win2000). I want this back into my box when linux is running on my new hd. There are probably some important files on /dev/hda1 (the boot partition) that somehow needs to be copied to the new hd? LILO refer to /dev/hda1 as the boot partition for win2000, but the os is located on /dev/hdd1 (which i have removed for the moment). Phew... this looks like a mess to me :) Over the last 5-6 years i've had DOS, w95, w98, w2000 and various flavors of linux installed on my system.... Thanks for any help. |
OK. We need to do this carefully!
Firstly, PRINT a copy of your lilo.conf file and make a boot disk in case you 'loose' linux as I once did. It took me ages to work out how to get it back. It has been recommended only to copy partitions that are not being used, so you might want to get hold of a copy of knoppix that can run from a cd and use knoppix to copy your data over. This also gives you the advantage that if you 'loose' your linux, you can have a version of linux (knoppix) to use to get it back! I am not sure it is a good idea to have /boot as a separate partition. Why would you want to do that? I just have /boot as a directory in my / partition. Lilo goes on the MBR of the boot disk. [See later!] So I would set up your hdd partitions like this: hdd1 / hdd2 /home hdd3 swap hdd4 /usr hdd5 /storage Now format each partition as whatever you like. Journalling seems to be "a good thing", so I am using ext3 Now mount /dev/hdd1 as /mnt/newroot, and create in /mnt/newroot/ all the directories you currently have listed in / (your old or current root) EXCEPT /proc and /mnt. /proc is virtual, so there is no point in copying it, and if you think about it, trying to copy over /mnt could lead to a recursive nightmare. Make sure your new (empty) directories in /mnt/newroot/ have the same perms as the old ones in / Ideally you now run something like knoppix direct from the CD. This will allow you to mount your old root partition at /mnt/oldroot, and your new root partition at /mnt/newroot. If you cannot do this, go to single user mode, and I think you should be OK. The idea is that the filesystem should not be active or changing whilst you are copying it, otherwise you may end up with a whole load of inconsistencies! Copy the contents of each directory (except /proc and /mnt) like this: Code:
#cd /mnt/oldroot/bin You might see an error like "tar: ./log: socket ignored", but this doesn't matter. Don't forget to copy over any lonely files that might be lying around in / Now do the same thing for /usr /home and /storage eg: Code:
#mkdir /mnt/newhome You need to edit /mnt/newroot/etc/fstab to reflect the fact that hdd1 is going to be your new / partition, and similar for the other partitions on hdd. Now there is just one more problem: You can see from your fdisk output above that /dev/hda1 is your boot disk, and lilo is on that disk's MBR. You need to reboot to your old linux on hda. Tell lilo about your new linux on hdd, and make a boot menu entry for linux-hdd. Try booting your linux-hdd. Does it look ok and work ok?. If so, you are almost ready to finish up. If not, go back and fix things up until you can boot and run linux-hdd from lilo. Remember, lilo is still on the MBR of hda. If you remove hda you will not be able to boot hdd, even if you plug its cable into where hda was. You'll have to 'man lilo' to sort this out, as I am at work (and, er, not working it seems!). Maybe the thing to do is use fdisk to mark hdd as the boot disk, and then run /sbin/lilo to write its thing to the MBR of hdd, but I am not sure here. Have fun, its an amusing exercise, and highly satisfying when you finally get it right. Maybe you'd like to condense this thread into a HOWTO as this sort of problem seems to crop up fairly often. Do not #rm -RF anything from hda until you are completely happy that all is well set up on hdd. Good luck. |
another success story (...in progress)
Hi again...
So far, so good :) - just a progress report: Code:
bash-2.05b# fdisk -l /dev/hdd && echo "" && df The only thing left for me to do is to install lilo on mbr on hdd & remove the old disk. (update: i just did that. installed lilo with: "lilo -b /dev/hdd1", edited fstab, removed hda, reboot - all ok) Thanks for all help. |
It looks as though you have cracked the problem, including how to sort out lilo. I didn't know about /sys on Slackware 10, so that is useful information too.
It is interesting that you did not need to run knoppix, but I am assuming that you remembered to go to single user mode when you were copying the files over. Congratulations! |
All times are GMT -5. The time now is 11:00 PM. |