You are not logged in.

#1 2021-02-21 22:40:57

rytulsq
Member
Registered: 2021-02-21
Posts: 3

Recover my data after a miswritten command

Hey!

I'm facing an issue because I have miswritten a command and now I don't know how to recover my data.
I have run unintentionally a command,

bootinfoscript /dev/nvme0n1

The command was not complete, I should have written (for ex)

bootinfoscript /dev/nvme0n1/name_of_output_file.txt

I rebooted to a live iso and the 2 partitions on the disk are not shown (1 for boot and the other is luks encrypted)

Is it possible to recover the data on my disk ? I don't think it's possible that all bits were erased so my data is still on the disk ?

I miss knowledge to do it. Firstly I searched and tried some things with fsck but I'm facing a "bad magic number..."
Secondly I have run

fdisk /dev/nvme0n1

and it said it will write something but I don't remember what exactly..

So know I'm here to find some help hmm
(I'm not english, I'm trying my best but sry  for the mistakes)

Offline

#2 2021-02-21 22:48:20

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: Recover my data after a miswritten command

Both commands would've been wrong in any case, if you want an output file on your root partition write it from that perspective so /name_of_output_file.txt

There's never a reason to try and write to the device file in the way you tried to do it and you would have broken something regardless.

try running testdisk on it would be my guess.

Last edited by V1del (2021-02-21 22:48:56)

Offline

#3 2021-02-21 23:31:56

rytulsq
Member
Registered: 2021-02-21
Posts: 3

Re: Recover my data after a miswritten command

Yep, I know I made a mistake hmm
I should have read more documentation about bootinfoscript and should have think better after writing this command with /dev/...

I'm running testdisk from an arch live iso now, hope it will work.

Thank you !

Offline

#4 2021-02-23 02:37:08

rytulsq
Member
Registered: 2021-02-21
Posts: 3

Re: Recover my data after a miswritten command

Ok, so, I've run testdisk and now the 2 partitions are shown, I can also decrypt my 2nd partition but it shows only my root volume, not the home volume.

I made an image of /dev/mapper/lvm with testdisk and now I'm running photorec on the image.dd file.

Offline

Board footer

Powered by FluxBB