7

I have external hard drive which is 300GB. I set it to format to NTFS. Well there wasn't FAT32 in the list, though I know on Windows it asks me to set FAT32 because it has large capacity.

It started formating but I didn't get any window that shows progress. I just see the LED diode flashing all the time, meaning the disk works something.

I also tried to restart the PC but it asked me for my user password with a message that I should not restart at this time.

How can I know the progress of formatting my external hard drive on Ubuntu 16.04 ?

PS. should I close my PC forcefully?

  • 1
    Which tool are you using? Some tools will only show, that you have finished, when you have finished, but no really useful progress information. But it should not be too slow, try to wait for it to finish (for a few minutes). – sudodus Oct 7 '17 at 17:06
  • 2
    @sudodus I don't remember the tool. Its just right click on the drive icon in the task bar(Unity) and then I pressed format. But it took like 2 hours now, still blinking diode. – Vlad Oct 7 '17 at 17:08
  • 1
    @sudodus yes it is on USB 2, and yes I chose slow format, not a quick format. Its been a while since I formated it. I wanted it to be clean from garbage. – Vlad Oct 7 '17 at 17:14
  • 3
    Slow format on USB 2. Well, it is probably working like it should (and you are probably using Disks alias gnome-disks under the hood). I suggest that you are patient and wait (probably for some more hours) if possible. – sudodus Oct 7 '17 at 17:16
  • 1
    yes full format is very slow as it writes every block. a quick format just rewrites the file table – ravery Oct 7 '17 at 17:32
3

After a dialogue as comments, we can conclude

  • "I right clicked on the drive icon in the task bar(Unity) and then I pressed format."

  • Slow format on a USB 2 drive was selected for NTFS on 300 GB.

  • This will last for between 2 and 3 hours, and there is no feedback during the process, except signs that the computer and target drive are busy.

  • It was easy to see that the formatting was successful in the end.

| improve this answer | |
16

I had a similar situation where I right clicked a previously created partition on an external drive to reformat it. Once it had started there was no window of any sort to show the progress of the formatting. My solution was to open the Disk Utility which can easily be installed if it is not already available.

Once I opened Disk Utility I was able to select the partition being formatted and view the progress bar together with an estimation of the time remaining.

Note: when looking for Disk Utility amongst your apps only enter the term Disk as that is what it shows up as.

| improve this answer | |
  • 2
    For Disk Utility, to install - within CLI enter 'sudo apt-get install gnome-disk-utility'; to run from CLI enter command 'gnome-disks'; to run from GUI push 'Disks' icon – Alexey Antonenko Apr 10 '18 at 6:39
  • 2
    This should be the accepted answer. – Ivan Ivković Oct 27 '18 at 12:53
  • Yes, running the 'gnome-disks' command starts the GUI, which actually connects to whatever background format operation is going on, and at least gives a spinning wheel thing to show stuff is happening. Sadly, it doesn't appear to show the actual progress, only ongoing activity. – Toby Eggitt Sep 24 '19 at 0:14
0

I'm running on Ubuntu 18.04, but I suspect 16.04 should be the same. I recently had the same question and did some poking at it. I have an external HD that I wanted to format as a backup disk, the format ran for a long time but there was no information on how long it should take.

According to https://www.kernel.org/doc/Documentation/block/stat.txt , there is a counter of the number of sectors written. For a disk that is just added or partition just created, this number should start close to zero, and a format should be a simple linear write instead of skipping all around. So for my partition /dev/sda1, the number of sectors written can be found in /sys/block/sda/sda1/stat looking at the 7th field. Then you need to figure out the total number of sectors. To get that, I ran "fdisk -l /dev/sda1" and the number is present on the first line.

root@ubuntu:~/bin# fdisk -l /dev/sda1
Disk /dev/sda1: 4.1 TiB, 4501023490560 bytes, 8791061505 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Alignment offset: 512 bytes

Then if you can occasionally check the stat value and compare it to the total, you should have an idea of the progress. I'll include here a small shell script to print the percentage of progress. Using this, I was able to estimate that formatting my 4.5TB disk would take about 4 days, after letting it run for a day. Yeah, it is a cheap/slow external disk.

#!/bin/bash

# set -x

# look in /sys/block for this value
DEVICE=sda
# look in /sys/block/$DEVICE for this value
PARTITION=sda1

test -b /dev/$DEVICE
test -b /dev/$PARITION
test -d /sys/block/$DEVICE
test -d /sys/block/$DEVICE/$PARTITION

TOTAL_SECTORS=`fdisk -l /dev/$PARTITION 2>/dev/null | grep ' sectors$' | cut -f3 -d, | cut -f2 -d' '`
SECTOR_SIZE=`fdisk -l /dev/$PARTITION 2>/dev/null | grep '^Units' | cut -f8 -d' '`

while [ : ]
do
    WRITTEN_SECTORS=`cat /sys/block/$DEVICE/$PARTITION/stat | awk '{ print $7 }'`
    PERCENTAGE=`expr $WRITTEN_SECTORS \* 100 / $TOTAL_SECTORS`
    WRITTEN_MB=`expr $WRITTEN_SECTORS \* $SECTOR_SIZE / 1024 / 1024`

    READ_SECTORS=`cat /sys/block/$DEVICE/$PARTITION/stat | awk '{ print $3 }'`
    READ_MB=`expr $READ_SECTORS \* $SECTOR_SIZE / 1024 / 1024`

    echo "Written $WRITTEN_SECTORS sectors of $TOTAL_SECTORS (${PERCENTAGE}%) (${WRITTEN_MB}MB written, ${READ_MB}MB read)"
    sleep 1
done
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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