[CentOS] Mounting /var directory to a new HardDisk

Fri Jan 18 07:07:01 UTC 2008
Indunil Jayasooriya <indunil75 at gmail.com>

On Jan 18, 2008 9:08 AM, redhat at mckerrs.net <redhat at mckerrs.net> wrote:
> For sure you will be able to mount /var on your new disk....

Thank you very much for it.
>
> but not before you boot single user and copy all the contents across manually and then modify /etc/fstab to reflect the new location of /var.

If I boot from single user mode and copy /var directory to new
hardiisk, What will happent to permissions?

Then, What should I do to /var directory on OLD HardDisk. Should I
leave it alone or Should I rename it or Should I delete it?

Remember, Curently / and /opt and /boot and /swap  are MOUNTED. i.e
/var is under  / partition.

here is my /etc/fstab

[root at gateway root]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/opt              /opt                    ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/sda2               swap                    swap    defaults        0 0
/dev/sda3               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660
noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0


>
> In my experience it is nigh-on impossible to *move* /var when a system is running.

Noted.

> Hint : next time use LVM *even* if you only have 1 physical disk to start with. It makes this sort of situation an non-event.

Yes , I aggree with you.



-- 
Thank you
Indunil Jayasooriya