You are not logged in.

#1 2021-11-25 00:14:39

joaonunatings
Member
Registered: 2021-10-14
Posts: 22

[SOLVED] Recover full disk capacity after failed dd fill with random

Hi, today I was wiping an old drive (1TB space).

1) I deleted all partitions (using fdisk)
2) Then used dd status=progress if=/dev/urandom of=/dev/sdX bs=1M
3) dd got cancelled almost at the end of it
4) Now in fdisk I can only create a partition with 6.8GiB.

How can I recover all that filled space?

Last edited by joaonunatings (2021-11-25 19:43:49)


Sway on ASUS ZenBook UX434DA-UM433DA: AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx, 16GB RAM, Samsung MZVLB1T0HALR-1TB SSD, Keychron K12 with Banana Switches Keyboard

Offline

#2 2021-11-25 08:23:41

seth
Member
Registered: 2012-09-03
Posts: 25,134

Re: [SOLVED] Recover full disk capacity after failed dd fill with random

dd got cancelled almost at the end of it

How? Did you cancel it or did it abort?

Now in fdisk I can only create a partition with 6.8GiB.

fdisk -l

You probably want to check https://wiki.archlinux.org/title/Smart
Maybe dd if=/dev/zero onto the drives head helps, but I doubt so…

Offline

#3 2021-11-25 08:35:56

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

Re: [SOLVED] Recover full disk capacity after failed dd fill with random

if the capacity is no longer detected correctly, ( cat /proc/partitions and/or blockdev --getsize64 show the wrong size ) it is usually a hardware problem.

sometimes its possible for urandom to generate bogus partition tables (some partition formats don't have significant magic bytes to prevent mis-detection) so in case a program is simply confused by such byte patterns, then wipefs -a and/or zeroing might help

if the drive supports SMART you can also check smartctl -a, if it supports ata secure erase you can also try that, and for some drives even firmware updates may be applicable (but that's mostly SSDs)

but if its a hardware issue there's just nothing much you can do anymore, and neither should you trust such a misbehaving drive with data anymore

Offline

#4 2021-11-25 18:52:23

joaonunatings
Member
Registered: 2021-10-14
Posts: 22

Re: [SOLVED] Recover full disk capacity after failed dd fill with random

After rebooting computer I'm able to create a partition with the full capacity (931.5G). I was wondering if it's possible to check for drive specifications if this is the real full capacity size (I know that is a 1Tb drive from the shop where I bought, but sizes differ from actual memory that is free).

seth wrote:

How? Did you cancel it or did it abort?

I cancelled it.

seth wrote:
fdisk -l
Device     Boot Start        End    Sectors   Size Id Type
/dev/sda1        2048 1953525166 1953523119 931.5G 83 Linux
seth wrote:

You probably want to check https://wiki.archlinux.org/title/Smart

This drive has no SMART support.

frostschutz wrote:

if the capacity is no longer detected correctly, ( cat /proc/partitions and/or blockdev --getsize64 show the wrong size ) it is usually a hardware problem.

$ cat /proc/partitions
   8        0  976762583 sda
   8        1  976761559 sda1
$ blockdev --getsize64 /dev/sda
1000204885504

Last edited by joaonunatings (2021-11-25 19:06:30)


Sway on ASUS ZenBook UX434DA-UM433DA: AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx, 16GB RAM, Samsung MZVLB1T0HALR-1TB SSD, Keychron K12 with Banana Switches Keyboard

Offline

#5 2021-11-25 19:24:45

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 4,755

Re: [SOLVED] Recover full disk capacity after failed dd fill with random

joaonunatings wrote:

After rebooting computer I'm able to create a partition with the full capacity (931.5G). I was wondering if it's possible to check for drive specifications if this is the real full capacity size (I know that is a 1Tb drive from the shop where I bought, but sizes differ from actual memory that is free).

Yes. That's correct.
https://www.google.com/search?q=1TB+in+GiB


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Online

Board footer

Powered by FluxBB