[linux] [Wolves] Mounting var directory

Ron Wellsted wolves at mailman.lug.org.uk
Tue Jan 7 20:22:00 2003


On Tuesday 07 Jan 2003 7:17 pm, Wayne Morris wrote:
> On Tue, 2003-01-07 at 18:58, Wayne Morris wrote:
> > When I dug around and mounted hda5 , I found that this contains the var
> > directory and contents, so I have been trying to mount this on boot in
> > fstab with
> > /dev/hda5    /var    ext3 defaults 1 2
>
> This is sort of working now ,but giving the following error;
> #/boot : clean
> /home:  clean
> /dev/hda5 is mounted e2fsck cannot continue, aborting.
>
> An error occurred during the file system check
>
>
> Var now contains the correct sub directories, but I'm in 'Repair
> Filesystem' mode, and if I try to run fsck - it says 'running on a
> mounted filesystem make cause damage'
>
> Wayne

1. First off all, make sure you boot into single user mode ("linux 1" with 
lilo)
2. try "umount /dev/hda5" to unmount the /var filesystem
3. now "fsck /dev/hda5"
4. fsck the new filesystem
5. mount the new /var filesystem
6. "mount /dev/hda5 /mnt" this will mount the old /var on /mnt
7. cd /mnt
8. copy all files with "find . -depth -print | cpio -advm /var"
9. umount both old and new /var filesystems
10. fsck both old and new filesystems (to check the count of files is the 
same)
11. edit /etc/fstab to use the new /var (rather than /dev/hda5)
12. reboot linux to normal mode.

HTH

-- 
Ron Wellsted
http://www.wellsted.org.uk
mailto:ron@wellsted.org.uk