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

Re: /var and /home are gone

on Thu, Apr 17, 2003 at 03:12:11PM -0400, Jonathan Brandmeyer (jbrandmeyer@earthlink.net) wrote:
> Due to a series of stupid mistakes, I have managed to completely delete all
> of /home and /var.  Is there any way to recover?

Yes.  From your regularly and frequenlty performed backup archives.

Consider this a lesson learned.

> It went like this:
> / was getting too big for its partition, due to a large cache of packages in
> /var.

    # Use one of the following regularly.  man apt-get first.
    $ apt-get autoclean
    $ apt-get clean

> Partitioned out 2GB of free space for /var.
> mkfs.ext3 /dev/hdb6 (the new partition)
> mv /var /var.old
> mkdir /var
> edited /etc/fstab to add a line to mount /dev/hdb6 to /var
>     *BUT* I type-o'ed and mounted /dev/hdb5 to /var
>     (dev/hdb5 is /home)
> mv /var.old /var
> cd /var
> ls
> ( notice that my home directory is in there.  Wonder how.  Delete it.)
> cd /home
> (notice that /varish stuff is in there.  Wonder how.  Delete it too.  God
> how stupid.)
> init 2
> Notice that syslogd takes forever to start.  Seems to freeze, but then the
> system continues to startup.
> GDM can't find some file under /var.
> >From a TTY, go poking around.  Discover my error on /etc/fstab.  umount and
> mount to see what is actually there.  Discover /var and /home are nearly
> empty (only lost+found is there, it's empty) And scream.
> In theory, I know that most of the files should actually still be on the
> disk, but I have no idea how to recover them or if it is practically
> possible.
> Please Help,
> Jonathan

'mc' (midnight commander) can recover some files deleted from ext2fs
partitions, in the right circumstances.

> P.S.  In case it helps, here is my HDD setup:
> /dev/hdb1    ext2fs    /
> /dev/hdb2    swap
> /dev/hdb3    ext2fs    /usr
> /dev/hdb4    extended
> /dev/hdb5    ext3fs    /home
> /dev/hdb6    ext3fs    /var

Kiss your data goodbye.  Odds of successful journaled data recover are
slim to nill.

> /dev/hda1     ntfs       /winxp (read-only)

What!  You didn't nuke it while you had the chance ;-)


Karsten M. Self <kmself@ix.netcom.com>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
   Geek for hire:  http://kmself.home.netcom.com/resume.html

Reply to: