Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hello first of all i'm a newbie in Linux, I had a problem with the email server yesterday at work, it wouldn't start, said Filesystem NOT clean, and couldn't mount ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2012
    Posts
    5

    Lost folders after rebuild tree


    Hello first of all i'm a newbie in Linux,

    I had a problem with the email server yesterday at work, it wouldn't start, said Filesystem NOT clean, and couldn't mount the partitions.

    where is the fstab
    fstab
    /dev/hda1 swap swap defaults 0 0
    /dev/hda2 / reiserfs defaults 1 1
    /dev/hda3 /scci reiserfs defaults 1 2
    /dev/cdrom /mnt/cdrom auto noauto, owner,ro 0 0
    /dev/fd0 /mnt/floppy auto noauto, owner 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    proc /proc proc defaults 0 0

    So i did reiserfsck --check [device] and it suggested to use --rebuild-tree.
    when it was finished i was able start the server, and mail was back on, but it still couldn't mount /dev/hda3 /scci, i did a reiserfcsk --rebuild-tree /dev/hda3 and after that i was already able to mount /dev/hda /scci, but now the folders are not the same as before, in this partition was the files for the website in a folder 'www_v2'

    How can i retrieve this folder?

    Regards,
    Ricardo.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,378
    Hi and welcome.

    Just to recap:
    You did a reiserfsck --check on both /dev/hda2 and /dev/hda3
    Then you ran reiserfsck --rebuild-tree also on both /dev/hda2 and /dev/hda3

    After that, the system could boot, but /dev/hda3 was still not clean.
    So you ran reiserfsck --rebuild-tree again on /dev/hda3 and now it shows unknown files and directories?

    What rebuild tree does is to go over the disk, collect all "leaves" and build a new meta structure.
    Maybe it picked up previously deleted files by doing so.

    Did you look into the "lost+found" folder for your missing files?
    Other than that, it might be time to recover from backup.


    PS: The device names hdaX suggest, that this is a rather old system.
    Which might explain the unclean disk in the first place.
    Maybe the harddisc is broken.
    If it has the S.M.A.R.T. feature, you might want to check the disk health.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Oct 2012
    Posts
    5
    Hi Irithori,

    Yes it's an old system, that is correct, i ran reiserfsck --rebuild-tree on both /dev/hda2 and /dev/hda3, and on /dev/hda3 again, only after that i could mount /dev/hda3.

    The "lost+found" folder has many files, i still haven't looked at this, i'm learning as i go.
    How does this work? can i restore these files as they were?

    regards,
    Ricardo.

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,378
    If fsck finds files that it cannot clearly identify or associate with a directory structure,
    then these files end up in lost+found.

    From there you can copy them back to whereever you like.
    However, a lot of files in lost+found means, that the filesystem had severe problems.
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Oct 2012
    Posts
    5
    The files in lost+found are like '126896_136694' i don't know which ones i need to recover, when i copy them to another location will the files be rearranged in the folders?
    Is this a procedure i can do manually or do i need a script for this?

    regards,
    Ricardo.

  6. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,378
    Afaik, there is no script.
    You would need to identify the files and place them in the correct locations yourself.

    Which means, it is probably a better option to restore from backup.
    Also, -as mentioned- there are doubts about the health of that harddisc.

    You need to make sure, that it is still ok.
    Otherwise all copy actions (be it from lost+found or restore from backup) are in vain.
    You must always face the curtain with a bow.

  7. #7
    Just Joined!
    Join Date
    Oct 2012
    Posts
    5
    Ok, as i inherit this server, i don't know if there is a backup for the files/folders, problably yes, i just don't know where to look.
    In linux is there a usual name for a backup file?

    i really appreciate all the help your giving me

    regards,
    Ricardo.

  8. #8
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,378
    There is no backup by default.
    The admin of that machine has to choose, install and configure one.

    And depending on the tool, the restore procedure differs of course.
    If done correctly, the backup is not on the mail machine, but rather on a backup machine (or tapes managed by that backup machine):
    Should the mail server die unrecoverable, you do want the backup files to be elsewhere.

    Is the former admin still around?
    You might want to ask him/her.
    You must always face the curtain with a bow.

  9. #9
    Just Joined!
    Join Date
    Oct 2012
    Posts
    5
    No he's not around anymore, and doesn't answer emails.

    There's another server for data, and it has backup by tape, i'll look there.
    In case i found no backup, to recover the files i want, how can i see the real name of the files/folders instead of '126896_136694' ?

    regards,
    Ricardo.

  10. #10
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,378
    You cant. The names are lost.
    It is also likely, that the files in lost+found are damaged.

    With the help of the "file" command it is possible to determine the filetype.
    If that fails, the last thning to os is to open the files with a text editor and judge yourself.
    You must always face the curtain with a bow.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •