reparation of /var

1) make the new partition, & format with mkfs. (in my case hda3)

2) mount the new filesystem in /mnt

# mkdir /mnt/new
# mount /dev/hda3 /mnt/new

3) Go to single-user mode so that there is no rw activity on the directory during the process (could be messy…)

# init 1

(re-enter root password – wont work via ssh… gave me a shock!!)

4) Backup data in var only (not the /var directory itself)

# cd /var
# cp -ax * /mnt/new

5) Rename the /var directory (to make sure this has worked before deleting it!)

# cd /
# mv var var.old

6) Make new var directory

# mkdir var

7) Unmount the new partition

# umount /dev/hda3

8) Remount it as /var

# mount /dev/hda3 /var

9) Edit /etc/fstab to include the new partition, with /var given as the mount point, so that it will be included in the filetree automatically at boot.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s