Re: changing /var's partition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Son, 2003-05-25 um 19.51 schrieb Nick H Johnson:
> I'm pulling an older smaller Hdd out of my box.  /var is on it's own
> partition on that drive (hda2).  What is the easiest way to move it to
> the larger drive on which the rest of my system lives and modify my
> fstab 

I'm not shure, if I fully understand your question:

I suppose the easiest way is to boot from RedHat CD 1 into the rescue
system (if you didn't work with the resue system yet, try it first and
get an impression of how it works). You will find a /mnt directory entry
and you should perform the following steps:
1.
create 2 subdirs in /mnt (e.g. myroot and oldvar). 
2.
Then you can mount your partitions 
  (e.g. mount /dev/hdb3  /mnt/myroot and 
        mount /dev/hda2 /mnt/oldvar)
3.
create a new var dir in root
  mkdir /mnt/myroot/var
4.
copy all files from oldvar to the new location
  cp -r /mnt/oldvar/*  /mnt/myroot/var/
5.
edit the fstab and comment out the line which mounts the old var
partition and reboot (you should do this first, running your normal
system and save the original file as fstab.bak, You only need to rename
files instead of using vi).

Given your df and partition information, your current root fs is nearly
filled. So it may be a bad idea to add the var subdir to that partition.
You seem to have another Linux partition hdb2, which seems not to be in
use. If you can use this partition as your new /var, it's even easier to
do (and a better solution). While running your normal system just mount
that partition to a temporary location 
(like "mount /dev/hdb3 /mnt/disk") 
and copy the content of /var into it (cp -r /var/*  /mnt/disk/). Then
change in /etc/fstab /dev/hda2 to /dev/hdb2. (You must replace the
current string LABEL=/var by /dev/hdb2, make a backup copy first). Then
reboot and check. 

If it doesn't work, boot from CD into the rescue system und restore the
backup copy of fstab .


If you wish to get rid of the smaller HD (currently hda), you have to
make a second step: change all occurences of hdb? in /etc/fstab into
hda? (backup copy first!) with your favourite editor, shutdown the
system, remove the smaller hd, change the Jumper of the larger one to
master (it should be slave if it is the second hd on the same bus as the
smaller one) or connect it to the primary interface and reboot the
system. If it doesn't boot now, you have probably to install a new mbr.
Again, boot into the rescue mode (using RedHat CD 1) and chroot to your
system partition /dev/hda3 now, previously hdb3 (easy to do, chroot is
described on the screen). Run the following:
/usr/sbin/grub-install  /dev/hda

If it still doesn't work, roll back the second step as a whole (you need
not delete the new mbr, doesn't matter).

Good luck
Peter




-- 
Psyche-list mailing list
Psyche-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux