Well if he altered /dev/hda1, fdisk /mbr won't do anything since hda1 is
on the first partition and mbr is before any partition.
'ls >/dev/hda1' must have erase the boot sector of windows (that is not
an issue), the fat (that is much more a problem) and the root directory.
depending on how many datas were writen to the disk (the lenght of ls) ,
he might recover his files using the second fat (on dos fs there are 2
copies of the fat).
for that i recommend not writing anything to the partition, and using
tools from a floppy disk booted system (or use some standard utils from
linux to recover the files: make a backup of the first sectors that you
will modify using dd, then use dd to copy the second fat over the first
one, then try to mount /dev/hda1 from linux. if it works, get all the
files you need and try to go further: from your win95 install boot disk
run 'sys c:' to replace the boot sector ....)
Have fun
-----Message d'origine-----
De: Jack Barnett R [SMTP:[EMAIL PROTECTED]]
Date: mardi 12 janvier 1999 01:45
�: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Objet: Re: some doubts
You can also do it will tape drives, tar cvf /dev/rtf0 /tmp This will
write directly to tape since they don't have a file system.
One way you might be able to restore you win hard disk is to try and boot
with a dos flopyy and do a fdisk /mbr this will try to (re)create the
master boot disk on c drive. If the ls > overwrite to much data on the
begining of the drive it could of corputed the file alocation table. I'm
not sure how to get these back, unless a tool like norton disk doctor
could do it.
Anyone else on the list know if he can dump his hard drive 'image' to
another disk drive? Maybe there would be a way to do this, so he could
get some of the files off there? Just a thought
>
> According to Mike Werner: While burning my CPU.
> >
> > Jayatheerthan Venkatramanan wrote:
> > >
> > > hi,
> > > i have got a system with win95(hda1) and linux(hda5). i didnt mount
the
win95
> > > partition. but i was fiddling with /dev directory as root. at one
point
of
> > > time i redirected ls to /dev/hda1. because of that the win95
partition
got
> > > corrupted and was not getting booted.
> > >
> > > my question is:
> > > when i havent mounted the win95 partition, how is it that that
partition
> > > is accessible?
> > > how /dev/file is related to the device when not mounted?
> >
> > The way I understand it is that if the /dev/hd** is directly accessed
-
> > as you did - then it does not matter whether or not the partition is
> > mounted. By accessing the /dev/hd** as root you are doing a direct
> > access of the device itself, completely bypassing the userlevel
system
> > functions - like directory structures and filesystems - that are
usually
> > in place to prevent such mishaps. There are some system utilities
that
> > rely on such operations - such as fsck and mke2fs.
> >
> > Basically, any time that a /dev/* file is directly accessed by the
root
> > user, all the system safeguards get thrown right out the window.
What
> > is happening is a direct low level access of the physical device.
There
> > are certain times when such is needed, but usually with a system call
> > such as fsck or mke2fs acting as somewhat of a buffer. Or when doing
> > system programming - such as deep in the kernel. Under ordinary use,
> > about the closest that anyone should get is along the lines of 'cat
> > sound.au > /dev/sound' or some such thing (I'm not sure of that one -
> > haven't got a sound card yet. Corrections?).
>
> No comment on the above, it explanes the situation well, however i did
a
> little experiment to "try" to simulate the origanal problem.
>
> I placed a clean floppy in /dev/fd0 and created a ext2 filesystem, i
then
> copied a few executable scripts and did what was explained in the
origanal
> post 'ls > /dev/fd0' floppy was not mounted, the 'ls > /dev/fd0' was
done
> from/in the root '/' filesystem.
>
> Before i did the 'ls' i could execute the scripts from the floppy no
> problem, now after doing the 'ls' when i try to mount the floppy;
>
> mount /dev/fd0
>
> VFS: Can't find an ext2 filesystem on dev 02:00.
> mount: wrong fs type, bad option, bad superblock on /dev/fd0,
> or too many mounted file systems
>
> fsck /dev/fd0
>
> Parallelizing fsck version 1.10 (24-Apr-97)
> e2fsck 1.10, 24-Apr-97 for EXT2 FS 0.5b, 95/08/09
> Couldn't find ext2 superblock, trying backup blocks...
> fsck.ext2: Attempt to read block from filesystem resulted in short read
> while trying to open /dev/fd0
> Could this be a zero-length partition?
>
> Ah!, now one would imagen that the origanal posters winhoze parition
has
> now been rendered utterly useless.
>
> Let this be a warning to everyone who insists on logging into thier
system
> as root while they don't really know what they are doing.
>
> Now why did i use a floppy for my experiment.?????
>
> >
> > >
> > > Thanx
> > > Jay
> > --
> > Mike Werner KA8YSD | "Where do you want to go today?"
> > ICQ# 12934898 | "As far from Redmond as possible!"
> > AIM Screen Name Reznaeous |
> > '91 GS500E |
> > Morgantown WV |
> >
>
> --
> Regards Richard.
> [EMAIL PROTECTED]
>
> Happy New Year, and may all your troubles be small (ones).
>