All of lore.kernel.org
 help / color / mirror / Atom feed
* I've done a very bad mistake
@ 2004-07-01 13:23 Andreas Otto
  2004-07-01 15:25 ` mjt
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andreas Otto @ 2004-07-01 13:23 UTC (permalink / raw)
  To: reiserfs-list

Hi,

  I've done as root: 
   >> cp some_file /dev/hdb7

  /dev/hdb7 is "was :-(" a reiserfs partition.

  Question?

  I need a tool with partition as input (dev/hdb7) and all not damaged files
  as output

  for me it is very important to get a solution ... help welcome :-)


mfg

  aotto


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: I've done a very bad mistake
  2004-07-01 13:23 I've done a very bad mistake Andreas Otto
@ 2004-07-01 15:25 ` mjt
  2004-07-01 15:36 ` Mikael Cluseau
  2004-07-01 17:33 ` Redeeman
  2 siblings, 0 replies; 8+ messages in thread
From: mjt @ 2004-07-01 15:25 UTC (permalink / raw)
  To: aotto1968; +Cc: reiserfs-list

On Thu, Jul 01, 2004 at 03:23:48PM +0200, Andreas Otto wrote:
>  I need a tool with partition as input (dev/hdb7) and all not damaged files
>  as output

I haven't tried dd_rescue but maybe you should read /dev/hdb7 with it
and skip the beginning, as much from the beginning as the accidentally
copied file is.

Then try fsck with some appropriate rebuild switches on the image.

-- 
mjt


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: I've done a very bad mistake
  2004-07-01 13:23 I've done a very bad mistake Andreas Otto
  2004-07-01 15:25 ` mjt
@ 2004-07-01 15:36 ` Mikael Cluseau
  2004-07-01 17:10   ` evilninja
  2004-07-01 17:33 ` Redeeman
  2 siblings, 1 reply; 8+ messages in thread
From: Mikael Cluseau @ 2004-07-01 15:36 UTC (permalink / raw)
  To: aotto1968; +Cc: reiserfs-list

Le jeu 01/07/2004 à 15:23, Andreas Otto a écrit :
> Hi,
> 
>   I've done as root: 
>    >> cp some_file /dev/hdb7

I remember that cp ask to *replace* a file, not to "put the source file
at the beginning of the target file". Did you really verified that your
partition was really modified ? I would be very surprised of this
attitude from cp...

In that case,

# rm /dev/hdb7 &&
# mknod /dev/hdb7 b 3 71

should work on a non-devfs system, and

# rm /dev/hdb7 &&
# ln -s ide/host0/bus0/target1/lun0/part7 /dev/hdb7

should work on a devfs system.

--
Mikael.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: I've done a very bad mistake
  2004-07-01 15:36 ` Mikael Cluseau
@ 2004-07-01 17:10   ` evilninja
  0 siblings, 0 replies; 8+ messages in thread
From: evilninja @ 2004-07-01 17:10 UTC (permalink / raw)
  To: Mikael Cluseau; +Cc: aotto1968, reiserfs-list

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mikael Cluseau schrieb:
> Le jeu 01/07/2004 à 15:23, Andreas Otto a écrit :
>
>>Hi,
>>
>>  I've done as root:
>>   >> cp some_file /dev/hdb7
>
>
> I remember that cp ask to *replace* a file, not to "put the source file
> at the beginning of the target file". Did you really verified that your
> partition was really modified ? I would be very surprised of this
> attitude from cp...

hm, i was curious about this and i set up a testimage via losetup, so i
can use /dev/loop0 as it it were real devices.

when cp'ing to /dev/loop0, i was able to mount /dev/loop0 again with
reiserfs, and no files are corrupted (diff). with ext3, i had to fsck
loop0, then one entry was taken to lost+found, but no corruptions
present as far as diff can tell. all this was done with devfs. so, "cp"
really writes *to* the file, it does not replace it, right?

maybe the OP only has to try latest reiserfsck...

just my 2¢,
Christian.
- --
BOFH excuse #112:

The monitor is plugged into the serial port
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA5EWTC/PVm5+NVoYRAg2zAKDlrJxWjxv/8+rFoR1bVpaedEzR1ACaA6yJ
aMJfJOfsq3TXpKbONOaiFEs=
=Iqji
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: I've done a very bad mistake
  2004-07-01 13:23 I've done a very bad mistake Andreas Otto
  2004-07-01 15:25 ` mjt
  2004-07-01 15:36 ` Mikael Cluseau
@ 2004-07-01 17:33 ` Redeeman
  2004-07-02  4:02   ` David Masover
  2 siblings, 1 reply; 8+ messages in thread
From: Redeeman @ 2004-07-01 17:33 UTC (permalink / raw)
  To: Reiserfs Mailinglist

afaik, this only overwrites the device node. recreate it, and you should
be fine

On Thu, 2004-07-01 at 15:23 +0200, Andreas Otto wrote:
> Hi,
> 
>   I've done as root: 
>    >> cp some_file /dev/hdb7
> 
>   /dev/hdb7 is "was :-(" a reiserfs partition.
> 
>   Question?
> 
>   I need a tool with partition as input (dev/hdb7) and all not damaged files
>   as output
> 
>   for me it is very important to get a solution ... help welcome :-)
> 
> 
> mfg
> 
>   aotto
> 
> 
-- 
Redeeman <redeeman@metanurb.dk>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: I've done a very bad mistake
  2004-07-01 17:33 ` Redeeman
@ 2004-07-02  4:02   ` David Masover
  2004-07-02 12:45     ` Redeeman
  0 siblings, 1 reply; 8+ messages in thread
From: David Masover @ 2004-07-02  4:02 UTC (permalink / raw)
  To: redeeman; +Cc: Reiserfs Mailinglist

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Redeeman wrote:
| afaik, this only overwrites the device node. recreate it, and you should
| be fine

Last I checked, it doesn't.  For instance, I often do

# cp file.img /dev/fd0
# cp /dev/fd0 file.img.test
# diff file.img file.img.test

to write a floppy from an image, then verify that the floppy matches the
image.

In fact, I think it detects if the destination is a device node and
behaves like 'dd' if it is.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIVAwUBQOTeQHgHNmZLgCUhAQI4HA//aqAFXvrN8avrfzc+eNFN1zIX3m7VFDk9
lll+gMpu9k6poet+40DOL3VFwHMaA/sk6e7MdmYQddYAu8Xk+OGXr/UAV70Hz6pF
juTdBVBSDuNB3xOyDBvrJ9e1hSTw0KmLaxNUvvKC2IoI24V2vLPijsCT0+4THd5i
P3SAmVZY9xGfTGFrt/u82fbfjv8sOYrLVfFVfD3v6M/swEcCqsCVBliJt0zYpLic
v48mcRzmEzGNVxubkd8o/F5EzsOoiHqcA2gZoTDTvFmsToT6anoL6lYeNLbkGuOc
5I5YPnX44V7skU/g+5wXRpLIBXi4NrhYJtwqyY44shNIX+b1DVFG/zHWBOBI9KEz
ImhoufwjFzErmKhBMZS5oyHrErtQru3fLDBWWDrrrN7x8Tdj1uEqFKEHhGucqjvs
ajQ75LqzjmIRewXQw/i+A7q8uB3nReQYTfnLpU0xIql9Xw9Mw+3eB5dnkuuZvOMi
opNRPdbEAxwSPGVybMskyVpaZWLO8gQQDUcOQYa2IUnGsL74qbPswdOkKgsHgwnw
iZyb5Je59BzsgKp2JdKhsZhS9k36F3lMqrmlX1+jupO7g/Ql2K6lw/rMjgqF2EcM
qMoRjy0zhTskQ4jrj9M7Ge5KFBqoEr4yi92etN+SaGtBUDKlIB6Jmta9j50o0XUw
rbnYmnz+JFM=
=JVWe
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: I've done a very bad mistake
  2004-07-02  4:02   ` David Masover
@ 2004-07-02 12:45     ` Redeeman
  0 siblings, 0 replies; 8+ messages in thread
From: Redeeman @ 2004-07-02 12:45 UTC (permalink / raw)
  To: Reiserfs Mailinglist

a device file is just a completely normal file.. almost..
i know this because i once did:

cp blah.blablabla /dev/null
and my null was replaced by this.

On Thu, 2004-07-01 at 23:02 -0500, David Masover wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> 
> Redeeman wrote:
> | afaik, this only overwrites the device node. recreate it, and you should
> | be fine
> 
> Last I checked, it doesn't.  For instance, I often do
> 
> # cp file.img /dev/fd0
> # cp /dev/fd0 file.img.test
> # diff file.img file.img.test
> 
> to write a floppy from an image, then verify that the floppy matches the
> image.
> 
> In fact, I think it detects if the destination is a device node and
> behaves like 'dd' if it is.
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iQIVAwUBQOTeQHgHNmZLgCUhAQI4HA//aqAFXvrN8avrfzc+eNFN1zIX3m7VFDk9
> lll+gMpu9k6poet+40DOL3VFwHMaA/sk6e7MdmYQddYAu8Xk+OGXr/UAV70Hz6pF
> juTdBVBSDuNB3xOyDBvrJ9e1hSTw0KmLaxNUvvKC2IoI24V2vLPijsCT0+4THd5i
> P3SAmVZY9xGfTGFrt/u82fbfjv8sOYrLVfFVfD3v6M/swEcCqsCVBliJt0zYpLic
> v48mcRzmEzGNVxubkd8o/F5EzsOoiHqcA2gZoTDTvFmsToT6anoL6lYeNLbkGuOc
> 5I5YPnX44V7skU/g+5wXRpLIBXi4NrhYJtwqyY44shNIX+b1DVFG/zHWBOBI9KEz
> ImhoufwjFzErmKhBMZS5oyHrErtQru3fLDBWWDrrrN7x8Tdj1uEqFKEHhGucqjvs
> ajQ75LqzjmIRewXQw/i+A7q8uB3nReQYTfnLpU0xIql9Xw9Mw+3eB5dnkuuZvOMi
> opNRPdbEAxwSPGVybMskyVpaZWLO8gQQDUcOQYa2IUnGsL74qbPswdOkKgsHgwnw
> iZyb5Je59BzsgKp2JdKhsZhS9k36F3lMqrmlX1+jupO7g/Ql2K6lw/rMjgqF2EcM
> qMoRjy0zhTskQ4jrj9M7Ge5KFBqoEr4yi92etN+SaGtBUDKlIB6Jmta9j50o0XUw
> rbnYmnz+JFM=
> =JVWe
> -----END PGP SIGNATURE-----
> 
-- 
Redeeman <redeeman@metanurb.dk>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: I've done a very bad mistake
@ 2004-07-06  6:28 Andreas Otto
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Otto @ 2004-07-06  6:28 UTC (permalink / raw)
  To: reiserfs-list

Hi,

  cp writes to the file and !!overwrite!! everythin at the beginning
  including bootsector, logs, ....

 just more information:

basic step:
 1. /dev/hdb7 was 40G with 20G data and 1.5G overwritten at the beginning
 2. dd_rescue cp the device into the file
 3. I splitt the 40G file into 100M pieces
 4. do strings at the pieces to extract all strings
 5. start to search 'grep' for the data (ascii source code) I was missing
 6. 2 day ago I've done a backup with a tar file
 7. found tar file (was broken) but I was able to extract the ascii data
    ==>> !!! never use gzip Archive !!! <<== if someting get very very wrong
   you can always recover ascii data even if near everything was broken
  => well done :-)
 
advanced step:
1. build superblock on dev/hdb7
2. build transaction log on dev/hdb7
3. fsck.resierfs --rebuild-tree seems to work
4. after mounting dev/hdb7 the fs was empty  :-(
5. but lost+found was filled :-)
    -> got 1 important archive back :-)))
6. but something I dont like ...
   20G data, 1.5G overwritten at the beginning but got only 8.7G back in 
   lost+found. the 8.7G was mainly a couple of big archive files.
  together 122 files from ~10.000 files

=> question to the reiserfs guys 

   Why was the recover rate so bad?


mfg

  aotto


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-07-06  6:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-01 13:23 I've done a very bad mistake Andreas Otto
2004-07-01 15:25 ` mjt
2004-07-01 15:36 ` Mikael Cluseau
2004-07-01 17:10   ` evilninja
2004-07-01 17:33 ` Redeeman
2004-07-02  4:02   ` David Masover
2004-07-02 12:45     ` Redeeman
  -- strict thread matches above, loose matches on Subject: below --
2004-07-06  6:28 Andreas Otto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.