nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

how to recover correupted filesystem?

This is a discussion on how to recover correupted filesystem? within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; hi guys, iam RHCE student today my teacher gave an kickstart file which is very dangerous see its postscript %post ...


Go Back   nixCraft Linux Forum > Linux Distribution > CentOS / RHEL / Fedora

Linux answers from nixCraft.


CentOS / RHEL / Fedora Discussion about Redhat Enterprise Linux or CentOS or Fedora Linux related problems.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 30-03-2009, 01:58 AM
Junior Member
User
 
Join Date: Jun 2008
OS: RHEL
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
ashu.wifi is on a distinguished road
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
Reply With Quote
  #2 (permalink)  
Old 30-03-2009, 05:31 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
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.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 30-03-2009, 11:13 PM
Junior Member
User
 
Join Date: Jun 2008
OS: RHEL
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
ashu.wifi is on a distinguished road
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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
mounting an NFS filesystem with iptables natashak Networking, Firewalls and Security 2 29-11-2007 11:26 PM
HP unix check filesystem for errors jerry HP-UX 0 09-06-2007 01:49 AM
expand a filesystem indiresh Linux software 1 07-12-2006 03:59 PM
Unable to unmount a filesystem because of zombie processes toor Linux software 2 28-06-2006 12:13 PM
How do I recover a bzip2 file? jerry Linux software 1 14-06-2006 04:27 PM


All times are GMT +5.5. The time now is 02:37 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38