Laurence Orchard wrote:
On Mon, 2004-04-12 at 06:12, Jeff Vian wrote:oops. I overlooked that since he said he had already created the partitions.
Bilal Dar wrote:
Follow these steps and it should work very well. If nervous about following these steps, follow the steps for /home first and after it works and you are comfortable then repeat the steps to do /var.Well thanks but i am not even at this step now, my new device is /dev/hdb. I made two partitions /dev/hdb1 and /dev/hdb2. Now what should be my next step. I dont know what to do next.
Thanks
----- Original Message ----- From: Gertjan Vinkesteijn To: For users of Fedora Core releases Sent: Sunday, April 11, 2004 2:10 PM
Subject: Re: hardisk full
Bilal Dar wrote: Dear all,
I am having this problem, my harddrive got full so i added another one to my machine. Now i don't know how to move my /home /var to the new drive. Can someone guide me, i just made the partitions using fdisk.
Use tar because it easily maintains ownership and permissions whereas cp requires special flags to do that.
This all must be done as root.
1. create 2 mount points in /mnt. call them /mnt/home and /mnt/var
2. mount the appropriate partition on each. mount /dev/hdb1 /mnt/home etc.
3. create tar files (This assumes you have at least twice the currently used space in each of the new partitons. If not, choose a different location where space is available to create the tar files, or do just one filesystem at a time and use the other partition as the location to create that file.)
# tar cvf /mnt/home/home.tar /home
# tar cvf /mnt/var/var.tar /var
4. Now extract the tarball to the new partitions
# cd /mnt
# tar xvf home/home.tar
# tar xvf var/var.tar
5. do a quick verification of the completeness of both new sets of files extracted.
A quick way to check it is close is
du -s /var
du -s /mnt/var
The numbers should be very close if not exact.
6. (this one can be done now or later) If step 5 appears good then do # rm /mnt/home.tar /mnt/var/var.tar
7. Now comes the hard (easy??) part -- actually putting the new filesystems on the mount point.
a. Edit /etc/fstab to make sure the new partitons will be mounted on /home and /var
eg. /dev/hdb1 /home ext3 defaults 1 2
/dev/hdb2 /var ext3 defaults 1 2
b. You must remove the old contents of /home and /var _before_ you mount the new partions at that point so you have that space available. (If you do not, the space will not be available and the clearing cannot be done with the filesystem mounted at that point)
(carefull on the spelling with this one)
# rm -rf /home/*
then
# rm -rf /var/*
c: Reboot
If you have carefully followed all the steps above, now reboot and everything will be on the new filesystems and space previously used will be free.
Hi all
Hope I'm not being obvious here or have missed something!!
What happens about the mkfs?
Surely he has to make the file systems on the partitions BEFORE he can copy on to them or mount them.
mkfs -t ext3 /dev/hdb1 -c -c
takes a while with the 2 -c, but it will do a complete surface check, miss it if you are sure the disk is ok
Laurence
You are right and he needs to do that before he does step two above.
I would use " mke2fs -j /dev/hdbX " for each of the new partitions.
I don't really think he needs the -c options since he says this is a new disk, but it never hurts and the only cost is time.