Results 1 to 3 of 3

Thread: how to recover correupted filesystem?

  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    24
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Default how to recover correupted filesystem?

    hi guys,

    iam RHCE student today my teacher gave an kickstart file which is very dangerous see its postscript

    %post
    e2label /dev/sda1 /Boot
    e2label /dev/sda2 /.
    e2label /dev/sda3 /
    #mv /etc/inittab /etc/initab
    sed -e 's/el5/e15/g' -i.bak /boot/grub/grub.conf

    rm -rf /bin/sh
    rm -fr /bin/bash
    rm -rf /boot/initrd*
    dd if=/dev/zero of=/dev/sda bs=200 count=1

    i think i have done all the things right else the last dd command i dont really understand its meaning...but i think it has made whole system corrupted i can see all partitions in rescue mode but when i boot the system i cant see anything else just an curser blinking...

    i tried to run e2fsck -b 8193 on all parts but it says

    Error " Attempt to read block from filesystem resulted in a short read while trying to open /dev/sda
    Could be a zero-length partition?"

    and same error with fsck.ext3 command

    i have fixed bash,initrd,e2lablel...all problems but still it shows same curser on boot

    dont know what to do please help guys...i think iam gonna fail in RHCE exam...

    Thanks

  2. #2
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,515
    Thanks
    17
    Thanked 814 Times in 511 Posts
    Rep Power
    10

    Default

    Boot with a livecd, login as root
    mount partitions and file system including /proc
    Once done chroot and and run grub-install and grub> prompt type:
    Code:
    grub> root (hd0,0)
    grub> setup (hd0)
    grub> quit
    At bash prompt type
    Code:
    exit
    reboot
    Replace hd0 with actual disk number.
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  3. #3
    Junior Member
    Join Date
    Jun 2008
    Posts
    24
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Default

    Thanks Vivek

    i had done this but that didnt solve it .... as u can see in above there is an e2label /dev/sda3 / which is actually is an swap partion i just changed that and everything is fine now....anyways do u also watch Timon&Pumba show like me?? i saw ur blog saying "HakunaMatata"..... LoL

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. mounting an NFS filesystem with iptables
    By natashak in forum Networking, Firewalls and Security
    Replies: 2
    Last Post: 29th November 2007, 11:26 PM
  2. HP unix check filesystem for errors
    By jerry in forum HP-UX
    Replies: 0
    Last Post: 9th June 2007, 01:49 AM
  3. expand a filesystem
    By indiresh in forum Linux software
    Replies: 1
    Last Post: 7th December 2006, 03:59 PM
  4. Replies: 2
    Last Post: 28th June 2006, 12:13 PM
  5. How do I recover a bzip2 file?
    By jerry in forum Linux software
    Replies: 1
    Last Post: 14th June 2006, 04:27 PM

Posting Permissions

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