sda1 disk clean up
Hey guys,
This is the situation at hand. I got a new harddrive and put it in my linux box. I went ahead and formatted it and everything to sdb1. I have it mounted to /home directory, and changed the fstab file so that it knows. if I do a "df" command it show everything properly except that sda1 still has 13gig spaced used by the previous "/home" so my question is as follows. Is there a way to get rid of the /home directory on the sda1 drive so that I can have that space back? This is what the df shows. Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 37662088 13624628 22139384 39% / varrun 192724 56 192668 1% /var/run varlock 192724 0 192724 0% /var/lock udev 192724 48 192676 1% /dev devshm 192724 0 192724 0% /dev/shm /dev/sdb1 197572288 12989312 174625892 7% /home |
According to this, sda1 is the root of the filesystem, not just a old /home directory.
Quote:
Quote:
Open a terminal window, and mount sda1 and sdb1. mount /dev/sda1 /mnt/sda1 mount/dev/sdb1 /mnt/sdb1 2. move the files from /mnt/sda1/home to /mnt/sdb1/home. mv /mnt/sda1/home/* /mnt/sdb1/home Leave the /home folder on sda1; just move the files to sdb1. The empty /home folder on sda1 is the mount point for sdb1. 3. now the files are on sdb1, and 13 gig of space are freed up in your root partition. 4. umount sda1 and sdb1, shutdown the livecd, and reboot. |
The usual way:
1. log in as root on a text console 2. unmount /home 3. mount your new 'home' somewhere else - say /mnt/newhome 4. if the old /home was a different partition, mount that on /mnt/oldhome 5. Copy the old home to the new home 6. remove the stuff from the old home 7. unmount the /mnt/*home partitions 8. mount /home again |
Thanks!
Alright thanks guys, I got looking at what you were saying and it makes sense. So what I did was umount sdb1 and than go into the sda1 home and rm -f -r all the directories, than I mount -a and bingo! everything is good now.
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 37662088 827284 34936728 3% / varrun 192724 56 192668 1% /var/run varlock 192724 0 192724 0% /var/lock udev 192724 48 192676 1% /dev devshm 192724 0 192724 0% /dev/shm /dev/sdb1 197572288 12989312 174625892 7% /home Thanks for you guys help! Linux rocks! |
Slight Problem
Well I found a slight problem :( It isn't a huge problem but it is kind of annoying. Now it is /home/home :( any ideas?
|
Hehe - you must have created a 'home' directory on your home partition.
So - unmount it again, move all directories to the root directory of the partition (rather than in a 'home' directory), check '/home' to make sure it has the correct permissions, then mount the partition over /home. Just make sure you know what you're doing - you don't want to mistype something and pollute the / filesystem (or lose files). |
Thanks that worked :D
|
All times are GMT -5. The time now is 10:49 PM. |