Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #239281 > unrolled thread

disk recovery question

Started bySemih Ozlem <semihozlemlinuxuser@gmail.com>
First post2021-08-24 11:10 +0200
Last post2021-08-24 22:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  disk recovery question Semih Ozlem <semihozlemlinuxuser@gmail.com> - 2021-08-24 11:10 +0200
    Re: disk recovery question Reco <recoverym4n@enotuniq.net> - 2021-08-24 11:20 +0200
      Re: disk recovery question Ángel <debian-user@debian.16bits.net> - 2021-08-24 22:30 +0200

#239281 — disk recovery question

FromSemih Ozlem <semihozlemlinuxuser@gmail.com>
Date2021-08-24 11:10 +0200
Subjectdisk recovery question
Message-ID<CPABw-2pJ-81@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi everyone,

I accidentally turned my hard disk to swap (I was using a usb for swap,
when entering the command I wrote the wrong disk id). Can I recover the
disk to its previous form?

Thanks

[toc] | [next] | [standalone]


#239282

FromReco <recoverym4n@enotuniq.net>
Date2021-08-24 11:20 +0200
Message-ID<CPAL7-2sX-13@gated-at.bofh.it>
In reply to#239281
	Hi.

On Tue, Aug 24, 2021 at 12:04:40PM +0300, Semih Ozlem wrote:
> I accidentally turned my hard disk to swap (I was using a usb for swap,
> when entering the command I wrote the wrong disk id). Can I recover the
> disk to its previous form?

Most of the files are likely were left intact, but the partition table
is likely to be destroyed.
I suggest doing the usual:

1) Immediately copy all disk contents by ddrescue (or equvalent)
elsewhere.
2) Put the disk in question aside, do not attach it to anything.
3) Operate on disk copy from pt 1 only.
4) Install "testdisk" package, and feed your disk image to photorec (it's
provided by "testdisk").

Reco

[toc] | [prev] | [next] | [standalone]


#239288

FromÁngel <debian-user@debian.16bits.net>
Date2021-08-24 22:30 +0200
Message-ID<CPLdw-OF-3@gated-at.bofh.it>
In reply to#239282
On 2021-08-24 at 12:12 +0300, Reco wrote:
> 	Hi.
> 
> On Tue, Aug 24, 2021 at 12:04:40PM +0300, Semih Ozlem wrote:
> > I accidentally turned my hard disk to swap (I was using a usb for
> > swap,
> > when entering the command I wrote the wrong disk id). Can I recover
> > the
> > disk to its previous form?
> 
> Most of the files are likely were left intact, but the partition
> table
> is likely to be destroyed.
> I suggest doing the usual:
> 
> 1) Immediately copy all disk contents by ddrescue (or equvalent)
> elsewhere.
> 2) Put the disk in question aside, do not attach it to anything.
> 3) Operate on disk copy from pt 1 only.
> 4) Install "testdisk" package, and feed your disk image to photorec
> (it's
> provided by "testdisk").
> 
> Reco

Actually, testdisk itself (not photorec) is probably able to recover
the header. mkswap seems to only touch little more than the first 1000
bytes (plus a label). *If* it wasn't actually used as a swap disk (in
which case, who knows what might have been overwritten), everything
will be there.

If you turned into a swap the full disk, and not a partition, then
"only" the partition table and/or bootloader will have been
overwritten, which should be quite recoverable by testdisk (and
reinstalling grub, probably).

Good luck

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web