mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2016-11-01, 11:46   #1
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

480010 Posts
Talking Hope I'm not OT...

I just bought an external Maxtor hard disk (5,400 rpm, USB 3) and decided to deep format it as ext4 with zeroed sectors (I am on Ubuntu 16.04 LTS).

Unfortunately, a power outage turned the PC off in the middle of the operation; now I can see the disk in the partition table but can't access it either for reading or for formatting. I suspect the superblock was missing, tried to replace it with the copy at 32768 without success.

The hard disk is new, nothing was saved on it apart from the user manuals.

Any hints on how to recover it back to life?
ET_ is offline   Reply With Quote
Old 2016-11-01, 12:29   #2
Zr40
 
Dec 2013

32 Posts
Default

The format operation was interrupted. Just format it again and it should work perfectly

Usually you wouldn't have to zero out all sectors either. That's only really useful when you want to make existing data unrecoverable, like when you're giving away the disk.

Last fiddled with by Zr40 on 2016-11-01 at 12:34
Zr40 is offline   Reply With Quote
Old 2016-11-01, 12:46   #3
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26·3·52 Posts
Default

Quote:
Originally Posted by Zr40 View Post
The format operation was interrupted. Just format it again and it should work perfectly

Usually you wouldn't have to zero out all sectors either. That's only really useful when you want to make existing data unrecoverable, like when you're giving away the disk.
The problem is I can't see the disk anymore... neither from Nautilus, not from the bash window...
ET_ is offline   Reply With Quote
Old 2016-11-01, 13:00   #4
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

37×97 Posts
Default

Is it partitioned?

Find what /dev device it currently is, maybe by running dmesg after you plug it in -- it will be in one of the last few lines. Make sure it is not mounted by running mount (and, on its mount point, umount if necessary). Then run: mkfs-ext4 /dev/whatever. Specifying the wrong device might wipe your main disk!

Last fiddled with by paulunderwood on 2016-11-01 at 13:27
paulunderwood is offline   Reply With Quote
Old 2016-11-01, 13:12   #5
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

3,613 Posts
Default

You might be able to see it using the Disks utility. Choose the dash and type dis and it should show up. You should be able to identify it by turning it off and on and see what shows up in the list in the left pane. As mentioned before, be careful to identify the correct device. If you identify it, there are some limited tools in Disks. GParted has more power than Disks and you might try it, if you haven't. Again be sure to identify the correct device. I often use df -h with and without the device turned on to see where it is.

A last thought, if none of the other methods succeed, is, if you can identify it to something like sda, or such, you can use dd (carefully) to clone a smaller drive onto it and then go back in and repartition/format.
EdH is offline   Reply With Quote
Old 2016-11-01, 13:23   #6
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

79×101 Posts
Default

As mentioned earlier, knowing the device name is the first hurdle.

Once you know that, you can view the disk with fdisk to see if it is partitioned. (Most likely your aborted format destroyed any partitioning information on your disk.)

In our case, our drive is /dev/sda so we reference it that way.

Note that sda is the disk and sda1, sda2 and sda3 are the partitions.

Code:
# fdisk -l /dev/sda

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F9C52F4B-E96F-4511-B1A2-8D0C4682D2FC

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1050623   1048576   512M EFI System
/dev/sda2    1050624 454993919 453943296 216.5G Linux filesystem
/dev/sda3  454993920 488396799  33402880    16G Linux swap
Xyzzy is offline   Reply With Quote
Old 2016-11-01, 13:34   #7
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

10010110000002 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
Is it partitioned?

Find what /dev device it currently is, maybe by running dmesg after you plug it in -- it will be in one of the last few lines. Make sure it is not mounted by running mount (and, on its mount point, umount if necessary). Then run: mkfs-ext4 /dev/whatever. Specifying the wrong device might wipe your main disk!
sudo mkfs-ext4 /dev/sdb

sudo: mkfs-ext4: command not found
ET_ is offline   Reply With Quote
Old 2016-11-01, 13:37   #8
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

1110000001012 Posts
Default

On my debian system it is : mkfs.ext4
paulunderwood is offline   Reply With Quote
Old 2016-11-01, 13:51   #9
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26×3×52 Posts
Default

I solved the first issue with gparted. Now the new drive is automatically mounted when I plug it in. Unfortunately, it looks as read-only, while gparted shows a small key near the ext4 definition. Are ext4 partitions cyphered? Is there a way to get rid of that small key ?

The actual situation is attached as image.
Attached Thumbnails
Click image for larger version

Name:	aaa.jpg
Views:	86
Size:	67.1 KB
ID:	15088  
ET_ is offline   Reply With Quote
Old 2016-11-01, 14:00   #10
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

79×101 Posts
Default

Post the contents of the /etc/fstab file.
Xyzzy is offline   Reply With Quote
Old 2016-11-01, 14:01   #11
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26·3·52 Posts
Default

Quote:
Originally Posted by Xyzzy View Post
Post the contents of the /etc/fstab file.
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=6383d57e-c1b1-4cc2-9239-ca33274bcd5c /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=87B8-CBD8  /boot/efi       vfat    defaults        0       1
# swap was on /dev/sda3 during installation
UUID=cfde83b0-f373-488e-ad9d-11fe38d6483b none            swap    sw              0       0
It looks like it was mounted as RO after an error... owned by root.

Last fiddled with by ET_ on 2016-11-01 at 14:12
ET_ is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reserved for MF - Sequence 4788 schickel Aliquot Sequences 2934 2021-01-07 18:52
Is there hope for the GPU shortage on the horizon? tServo GPU Computing 15 2018-03-08 22:20
Finding Cancer Hope in a Toxic Wasteland ewmayer Science & Technology 62 2007-11-11 04:05
Fermat's Last Theorem: a new hope ET_ Math 36 2005-11-10 22:15
I hope the new Apple store in Chicago opening today... Paulie Software 4 2003-07-16 14:19

All times are UTC. The time now is 17:10.

Thu Feb 25 17:10:35 UTC 2021 up 84 days, 13:21, 0 users, load averages: 1.81, 1.86, 1.90

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.