Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am attempting to fix the partition table on a 1 TB hard drive. GParted on my live disk sees the drive as being "2 TiB"... It is clearly labelled as 1 TB on the outside.

I started a low level reformat using dd but it is progressing at about 290 Kbps. It is going to take approximately 55 days to format this drive at that rate. Not exactly acceptable. Can I abort this and try some other method?

The drive is connected via USB 2.0 and dd is running off of a live disk. Can I abort the operation without harming the hard drive? There is no data on the drive, I want to make it usable.

share|improve this question
    
Also, the fact that dd is because you didn't specify a block size. Add bs=1M (or 10M) should speed things up quite a bit and reduce the time taken to something more reasonable like a few hours. –  André Daniel Aug 31 at 2:58

2 Answers 2

up vote 1 down vote accepted

Yes, you can abort dd.

Just go to the terminal where dd is running and press Ctrl+C.

Aborting dd will not roll things back to the way they were before dd started writing a stream of data to the disk. But that's fine, because you don't need that.

If your goal is just to clear out all the partitions on the disk and make a new partition table, you can do this in any partitioning utility. It's fast, because it doesn't write over most of the disk. Data might still be recoverable, but old files won't pop up out of nowhere or anything of the sort.

(And if you do need to securely erase the disk, dd might not be adequate for that.)

Writing a new partition table to the disk is traditionally what people mean when they say "low level format." Actually there's something else called that too, which is typically not possible through software, and which also doesn't involve writing data all over the disk. (Modern hard disks contain some data structures used internally by the drive firmware.) dd will not write in those "low level" areas.


As for the problem that motivated you to run dd on the drive in the first place, if creating a new partition table in GParted or other utilities doesn't fix it and make the disk's size appear correctly, I suspect dd wouldn't improve on that situation either.

There might be something (physically) wrong with the drive, but I wonder if maybe you've come up against some strange but in GParted (or the version of GParted you're using) instead. Do things work any differently with fdisk? (fdisk is not nearly as powerful as parted or gparted, but you don't need to move or resize any partitions, so it should be adequate to the task.)

If you haven't done so, I also recommend checking the drive for failure indicators and defects. Assuming it supports SMART (most drives these days do), you can use smartctl (see also this guide). You can scan the drive for surface defects with badblocks, though given how long dd was taking to run, that might take a long time.

share|improve this answer
    
Thanks for the info! I tried to create a new partition table with gparted and it threw an error. When I changed from the msdos partition table (to a different type) and tried to create one then gparted crashed. Sorry for lack of detail, I am not near the PC at the moment. I was hopeful that a low level reformat would fix the issue with the disk. The space currently shows as "unallocated" but displays 2tb of space when I know there is only 1tb. I believe this is why the partition table fails... Still unsure! –  Shrout1 Aug 30 at 21:09
1  
Hey! I am tempted to think that the drive is bad. Mac OS sees the disk as "2.2 TB Media" when connected via USB and Windows wouldn't give me a file size before initializing it. I've been using Disk Utility in Mac OS X for about 24 hours trying to get the drive in Extended Mac OS Journaled (HFS+?) format. It's still says there is a day left... Drive is under warranty so back it goes I think! –  Shrout1 Sep 1 at 2:38

Test gdisk.

It is available in Ubuntu Trusty Tahr 14.04.1 Live Iso.

Open a terminal.

Execute:

sudo su 
gdisk /dev/sd?

The gdisk program employs a user interface similar to that of Linux's fdisk, but gdisk modifies GPT partitions. It also has the capability of transforming MBR partitions or BSD disklabels into GPT partitions. Like the original fdisk program, gdisk does not modify disk structures until you explicitly write them to disk, so if you make a mistake, you can exit from the program with the 'q' option to leave your partitions unmodified.

When creating a fresh partition table, certain considerations may be in order:

For data disks, and for boot disks used on BIOS-based computers with GRUB as the boot loader, partitions may be created in whatever order and in whatever sizes are desired.

Boot disks for EFI-based systems require an EFI System Partition (gdisk internal code 0xEF00) formatted as FAT-32.

Some boot loaders for BIOS-based systems make use of a BIOS Boot Partition (gdisk internal code 0xEF02), in which the secondary boot loader is stored, possibly without the benefit of a filesystem.

If Windows is to boot from a GPT disk, a partition of type Microsoft Reserved (gdisk internal code 0x0C01) is recommended. This partition should be about 128 MiB in size. It ordinarily follows the EFI System Partition and immediately precedes the Windows data partitions.

Some OSes' GPT utilities create some blank space (typically 128 MiB) after each partition. The intent is to enable future disk utilities to use this space. Such free space is not required of GPT disks, but creating it may help in future disk maintenance.

Options:

-l List the partition table for the specified device and then exits.

b Save partition data to a backup file.

c Change the GPT name of a partition.

d Delete a partition.

i Show detailed partition information.

l Display a summary of partition types.

n Create a new partition.

o Clear out all partition data.

p Display basic partition summary data.

q Quit from the program without saving your changes.

r Enter the recovery & transformation menu.

s Sort partition entries.

t Change a single partition's type code.

v Verify disk.

w Write data.

? Print the menu.

share|improve this answer
    
Thanks! I am running off of a live cd and I'm not sure how well apt-get works in that environment. –  Shrout1 Aug 31 at 1:33
    
@Shrout1 apt-get does work on live. (You won't typically be able to install more software than fits in the live environment's RAMdisk, but that's usually only a problem when installing or upgrading a lot of software within the live environment.) You should be able to install and run gdisk without problems, if it's not in your live system, but it's likely already installed! (kyodake: you may want to update your post to reflect that it may already present). I've just checked on a 14.04.1 live ISO; it has gdisk. –  Eliah Kagan Aug 31 at 2:03
    
@eliah kagan Thanks again! I will give this suggestion a try if my other efforts fail :) –  Shrout1 Aug 31 at 2:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.