You are not logged in.

#1 2016-11-07 19:25:09

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,360

[SOLVED] Restore HD to factory

The background is I have recently (yesterday) popped an old NTFS HDD containing Windows 7 into my box. I wiped it, re-installed the partition table and formatted to Ext4. All went well, except that fsck won't touch it, claiming that either the superblock or partition table is corrupt (mismatched size).

I've tried e2fsck -cc, followed by resize2fs. The former completes (just shy of 11 hours, would rather avoid repeating if possible) whilst the latter wants me to run e2fsck -f. I've done that, but it still won't touch.

On route, I tried formatting as a gpt partition rather than mbr, which seemed to work, but the disk is invisible to mount etc. (fdisk -l sees it).

Now I'm at the stage where, if I can literally clear everything I may have a chance. Nothing I can find shows a way to simply remove everything (partitions, superblock, partition table) ready for a fresh start. Google spams me with data recovery options. There is no data to recover. I simply want a clean start.

Is there a way to do this.

NB. I've tried dd to zero the first 512, with no luck.

Last edited by Roken (2016-11-07 22:21:36)


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#2 2016-11-07 20:00:21

frostschutz
Member
Registered: 2013-11-15
Posts: 1,647

Re: [SOLVED] Restore HD to factory

Quick superficial method:

wipefs -a /dev/destroy?* /dev/destroy

Slow thorough method:

shred -v -n 1 /dev/destroy

If it's an SSD, instead:

blkdiscard /dev/destroy
echo 3 > /proc/sys/vm/drop_caches

I think your main issue is you used old partitions, had old filesystems mounted, or such things. mkfs an old partition, reboot and fsck the new partition which now is too small - of course it would complain. That or you actually have borked hardware, check dmesg, smartctl -a and run a selftest.

Last edited by frostschutz (2016-11-07 20:02:03)

Offline

#3 2016-11-07 20:05:46

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,360

Re: [SOLVED] Restore HD to factory

Shredding now. Let's see....I didn't even know that existed. TY.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#4 2016-11-07 21:06:30

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [SOLVED] Restore HD to factory

Are you sure blkdiscard requires dropping caches? All it seems to do is calling one ioctl and I think this syscall should be smart enough to invalidate any relevant caches. I also see no such recommendation in the man page.

Offline

#5 2016-11-07 21:25:34

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Restore HD to factory

You might be interested in reading this: https://www.vidarholen.net/~vidar/overw … e_data.pdf


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#6 2016-11-07 22:21:20

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,360

Re: [SOLVED] Restore HD to factory

Well, it's a spinner, not an SSD, so blkdiscard isn't an issue.

Shredding and starting over seems to have gotten me back to a clean superblock and partition table, so I'm marking as solved.

Thank you.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#7 2016-11-08 07:20:21

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [SOLVED] Restore HD to factory

Next time try wipefs. It takes only few seconds and should be enough to get rid of MBR and GPT tables.

Offline

#8 2016-11-08 09:56:16

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: [SOLVED] Restore HD to factory

Or let dd run for a few seconds...

Offline

#9 2016-11-08 19:14:44

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,360

Re: [SOLVED] Restore HD to factory

I considered it, but to be honest, shred on a 500Gb drive didn't take too long, and I watched a Netflix episode whilst it was at it smile


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

Board footer

Powered by FluxBB