Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
A few days ago I left an external hard drive connected to my MacBook. MacBook's battery drained and therefore the drive was "not properly disconnected". Ever since I can't have access to my drive anymore. I've been trying to mount it or verify it with Terminal as well as Single User Mode fsck -fy. But I haven't managed to succeed.

The original drive is 4TB and was formatted in ExFat. This is what I have tried in Terminal


diskutil list
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *4.0 TB disk2
1: EFI EFI 209.7 MB disk2s1
2: Microsoft Basic Data 4.0 TB disk2s2


diskutil verifydisk disk2
Started partition map verification on disk2
Checking prerequisites
Checking the partition list
Checking the partition map size
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking the EFI system partition's folder content
Checking all HFS data partition loader spaces
Checking booter partitions
Checking Core Storage Physical Volume partitions
The partition map appears to be OK
Finished partition map verification on disk2


diskutil verifyVolume disk2s2
Started file system verification on disk2s2
Verifying file system
** /dev/rdisk2s2
Invalid sector size: 0
File system check exit code is 8
Error: -69845: File system verify or repair failed
Underlying error: 8: POSIX reports: Exec format error

diskutil mount disk2s2
Volume on disk2s2 failed to mount
If the volume is damaged, try the "readOnly" option


diskutil mount readOnly disk2s2
Volume on disk2s2 failed to mount
If the volume is damaged, try the "readOnly" option


In Single User I used sbin/fsck_exfat /dev/disk2 but I had no luck
 
  • Like
Reactions: hobowankenobi

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
SOLVED: I solved the problem finally...

sudo fsck_exfat /dev/disk2s2
Password:
** Checking volume.
** Checking main boot region.
Main boot region is invalid. Trying alternate boot region.
** Checking alternate boot region.
** Checking system files.
** Volume name is AIMS Ext.
** Checking upper case translation table.
** Checking file system hierarchy.
** Checking active bitmap.
** Rechecking main boot region.
Main boot region needs to be updated.
Update? y
** Rechecking alternate boot region.
** The volume AIMS Ext was repaired successfully.

diskutil verifydisk disk2
Started partition map verification on disk2
Checking prerequisites
Checking the partition list
Checking the partition map size
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking the EFI system partition's folder content
Checking all HFS data partition loader spaces
Checking booter partitions
Checking Core Storage Physical Volume partitions
The partition map appears to be OK
Finished partition map verification on disk2

diskutil mount disk2s2
Volume AIMS Ext on disk2s2 mounted
 

utk27

macrumors newbie
Jun 20, 2018
2
0
I am not experienced neither with Terminal nor with Single User Moder. But I am getting my head into it, since I have exactly the same problem as you had. My question: the solution you have found, is it done with Terminal?
Thank you in advance for your patience with my newbie questions!
 

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
I am not experienced neither with Terminal nor with Single User Moder. But I am getting my head into it, since I have exactly the same problem as you had. My question: the solution you have found, is it done with Terminal?
Thank you in advance for your patience with my newbie questions!

Hi utk27,
yes, that's all done in terminal.
Paste each of this codes on terminal and press ENTER for each code.

First you need to find in which port your disk appears. for that type the following:

diskutil list
(This would give you a list of the devices and volumes you have plugged in. In my case it was disk2s2. Then proceed with the following codes)

sudo fsck_exfat /dev/disk2s2

diskutil verifydisk disk2

diskutil mount disk2s2


Let me know if it works. You can paste here what terminal tells you and I might be able to help you further.
 

utk27

macrumors newbie
Jun 20, 2018
2
0
Thank you for your reply. I am currently trying TestDisk, because none of the other options worked. This will take a while. Hopefully with success. Another option I would like to try -if I could get my hands on a windows computer- is to run Check Disk from a command line. I'll keep you updated.
 

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
Hi I am having the same issue with my WD 2 TB and i wanted to know if its safe to try sudo fsck_exfat /dev/disk2s2 but on a Mac Journaled drive.

@nacio can you help me with the command i need to type in terminal for the same?

Thank u
 
  • Like
Reactions: nacio

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
Hi I am having the same issue with my WD 2 TB and i wanted to know if its safe to try sudo fsck_exfat /dev/disk2s2 but on a Mac Journaled drive.

@nacio can you help me with the command i need to type in terminal for the same?

Thank u
Hi Jonathan, that command is totally safe. There's no risk of overwriting the data.

First make sure you have the correct disk location. Type the following on terminal...

diskutil list
[doublepost=1530299935][/doublepost]
Hi I am having the same issue with my WD 2 TB and i wanted to know if its safe to try sudo fsck_exfat /dev/disk2s2 but on a Mac Journaled drive.

@nacio can you help me with the command i need to type in terminal for the same?

Thank u

For Mac Journaled it should be sudo fsck_hfsplus /dev/disk2s2
 
Last edited:

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
Hi Jonathan, that command is totally safe. There's no risk of overwriting the data.

First make sure you have the correct disk location. Type the following on terminal...

diskutil list
[doublepost=1530299935][/doublepost]

For Mac Journaled it should be sudo fsck.hfsplus /dev/disk2s2
Thanks for the help @nacio but here's the msg i got...

sudo: fsck.hfsplus: command not found
 

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
sudo fsck_hfsplus /dev/disk2s2

Now it should work.

Hi @nacio here's what i did but got the same result...
Last login: Sat Jun 30 08:22:09 on console

MacBook-Pro-2:~ jonathanparis$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.3 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage Macintosh HD 499.4 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3


/dev/disk1 (internal, virtual):

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Macintosh HD +499.0 GB disk1

Logical Volume on disk0s2

55290B1E-E920-4BB2-97E2-04D66649447C

Unencrypted


/dev/disk2 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *2.0 TB disk2

1: Apple_HFS Elements 2.0 TB disk2s1


MacBook-Pro-2:~ jonathanparis$ sudo fsck_hfsplus /dev/disk2s1

Password:

sudo: fsck_hfsplus: command not found

Am i missing something???
 

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
Hi @nacio here's what i did but got the same result...
Last login: Sat Jun 30 08:22:09 on console

MacBook-Pro-2:~ jonathanparis$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.3 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage Macintosh HD 499.4 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3


/dev/disk1 (internal, virtual):

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Macintosh HD +499.0 GB disk1

Logical Volume on disk0s2

55290B1E-E920-4BB2-97E2-04D66649447C

Unencrypted


/dev/disk2 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *2.0 TB disk2

1: Apple_HFS Elements 2.0 TB disk2s1


MacBook-Pro-2:~ jonathanparis$ sudo fsck_hfsplus /dev/disk2s1

Password:

sudo: fsck_hfsplus: command not found

Am i missing something???

Hi Jonathan,

yes, I found the mistake. I was apparently giving you an erroneous command. Try first with this...

sudo fsck_hfs /dev/disk2s1

If not, then try with this...

sudo fsck_hfs -fy /dev/disk2s1

And before you try any of those SUDO commands, try first a diskutil repair with each of these 4 commands in that order.

diskutil verifyDisk disk2
diskutil verifyVolume disk2s1
diskutil repairDisk disk2
diskutil repairVolume disk2s1
 
Last edited:

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
Hi Jonathan,

yes, I found the mistake. I was apparently giving you an erroneous command. Try first with this...

sudo fsck_hfs /dev/disk2s1

If not, then try with this...

sudo fsck_hfs -fy /dev/disk2s1

And before you try any of those SUDO commands, try first a diskutil repair with each of these 4 commands in that order.

diskutil verifyDisk disk2
diskutil verifyVolume disk2s1
diskutil repairDisk disk2
diskutil repairVolume disk2s1

Debbies-MacBook-Air:~ debbiedavid$ diskutil verifyDisk disk2

Unable to verify this whole disk: A GUID Partition Table (GPT) partitioning scheme is required (-69773)

Debbies-MacBook-Air:~ debbiedavid$ diskutil verifyVolume disk2s1

Started file system verification on disk2s1 Elements

Verifying file system

Checking Journaled HFS Plus volume

The volume could not be verified completely

File system check exit code is 8

Error: -69845: File system verify or repair failed

Underlying error: 8: Exec format error

Debbies-MacBook-Air:~ debbiedavid$ diskutil repairDisk disk2

Unable to repair this whole disk: A GUID Partition Table (GPT) partitioning scheme is required (-69773)

Debbies-MacBook-Air:~ debbiedavid$ diskutil repairVolume disk2s1

Started file system repair on disk2s1 Elements

Repairing file system

Checking Journaled HFS Plus volume

The volume could not be verified completely

File system check exit code is 8

Updating boot support partitions for the volume as required

Error: -69845: File system verify or repair failed

Underlying error: 8: Exec format error

Debbies-MacBook-Air:~ debbiedavid$ sudo fsck_hfs /dev/disk2s1

Password:

** /dev/rdisk2s1

Executing fsck_hfs (version hfs-366.70.1).

** Checking Journaled HFS Plus volume.

** The volume could not be verified completely.

Debbies-MacBook-Air:~ debbiedavid$ sudo fsck_hfs -fy /dev/disk2s1

** /dev/rdisk2s1

Executing fsck_hfs (version hfs-366.70.1).

** Checking Journaled HFS Plus volume.

** The volume could not be verified completely.

@nacio HELP!!!
 

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
Debbies-MacBook-Air:~ debbiedavid$ diskutil verifyDisk disk2

Unable to verify this whole disk: A GUID Partition Table (GPT) partitioning scheme is required (-69773)

Debbies-MacBook-Air:~ debbiedavid$ diskutil verifyVolume disk2s1

Started file system verification on disk2s1 Elements

Verifying file system

Checking Journaled HFS Plus volume

The volume could not be verified completely

File system check exit code is 8

Error: -69845: File system verify or repair failed

Underlying error: 8: Exec format error

Debbies-MacBook-Air:~ debbiedavid$ diskutil repairDisk disk2

Unable to repair this whole disk: A GUID Partition Table (GPT) partitioning scheme is required (-69773)

Debbies-MacBook-Air:~ debbiedavid$ diskutil repairVolume disk2s1

Started file system repair on disk2s1 Elements

Repairing file system

Checking Journaled HFS Plus volume

The volume could not be verified completely

File system check exit code is 8

Updating boot support partitions for the volume as required

Error: -69845: File system verify or repair failed

Underlying error: 8: Exec format error

Debbies-MacBook-Air:~ debbiedavid$ sudo fsck_hfs /dev/disk2s1

Password:

** /dev/rdisk2s1

Executing fsck_hfs (version hfs-366.70.1).

** Checking Journaled HFS Plus volume.

** The volume could not be verified completely.

Debbies-MacBook-Air:~ debbiedavid$ sudo fsck_hfs -fy /dev/disk2s1

** /dev/rdisk2s1

Executing fsck_hfs (version hfs-366.70.1).

** Checking Journaled HFS Plus volume.

** The volume could not be verified completely.

@nacio HELP!!!

Try now with the following:

sudo gpt recover /dev/disk2
 

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
What will this do?? Just out of curiosity :)

The error you got while trying to verify the disk was A GUID Partition Table (GPT) partitioning scheme is required (-69773), so now the sudo gpt recover will try to recover and fix the GPT of the disk.
 

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
The error you got while trying to verify the disk was A GUID Partition Table (GPT) partitioning scheme is required (-69773), so now the sudo gpt recover will try to recover and fix the GPT of the disk.
Debbies-MacBook-Air:~ debbiedavid$ sudo gpt recover /dev/disk2

Password:

gpt recover: /dev/disk2: error: device contains a MBR

Sorry man need your help again! Thanks again :)
 

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
Debbies-MacBook-Air:~ debbiedavid$ sudo gpt recover /dev/disk2

Password:

gpt recover: /dev/disk2: error: device contains a MBR

Sorry man need your help again! Thanks again :)
Let's try creating a GPT...

sudo gpt create -fp /dev/disk2

then go for...

sudo gpt recover /dev/disk2

and finalise it with...

sudo gdisk /dev/disk2
 

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
Let's try creating a GPT...

sudo gpt create -fp /dev/disk2

then go for...

sudo gpt recover /dev/disk2

and finalise it with...

sudo gdisk /dev/disk2


Debbies-MacBook-Air:~ debbiedavid$ sudo gpt create -fp /dev/disk2

Password:

gpt create: /dev/disk2: error: no room for the backup header

Also got this pop up -
The disk you inserted was not readable by this computer.

Initialize / Ignore / Eject
 

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
Debbies-MacBook-Air:~ debbiedavid$ sudo gpt create -fp /dev/disk2

Password:

gpt create: /dev/disk2: error: no room for the backup header

Also got this pop up -
The disk you inserted was not readable by this computer.

Initialize / Ignore / Eject

Type this and copy the result...

sudo fdisk -l

or this...

gdisk /dev/disk2
 
Last edited:

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
Type this and copy the result...

sudo fdisk -l

Debbies-MacBook-Air:~ debbiedavid$ sudo fdisk -l

Password:

fdisk: illegal option -- l

usage: fdisk [-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size] [-r] [-a style] disk

-i: initialize disk with new MBR

-u: update MBR code, preserve partition table

-e: edit MBRs on disk interactively

-f: specify non-standard MBR template

-chs: specify disk geometry

-S: specify disk size

-r: read partition specs from stdin (implies -i)

-a: auto-partition with the given style

-d: dump partition table

-y: don't ask any questions

-t: test if disk is partitioned

`disk' is of the form /dev/rdisk0.

auto-partition styles:

boothfs 8Mb boot plus HFS+ root partition (default)

hfs Entire disk as one HFS+ partition

dos Entire disk as one DOS partition

raid Entire disk as one 0xAC partition
 

nacio

macrumors newbie
Original poster
Mar 31, 2018
11
3
Debbies-MacBook-Air:~ debbiedavid$ sudo fdisk -l

Password:

fdisk: illegal option -- l

usage: fdisk [-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size] [-r] [-a style] disk

-i: initialize disk with new MBR

-u: update MBR code, preserve partition table

-e: edit MBRs on disk interactively

-f: specify non-standard MBR template

-chs: specify disk geometry

-S: specify disk size

-r: read partition specs from stdin (implies -i)

-a: auto-partition with the given style

-d: dump partition table

-y: don't ask any questions

-t: test if disk is partitioned

`disk' is of the form /dev/rdisk0.

auto-partition styles:

boothfs 8Mb boot plus HFS+ root partition (default)

hfs Entire disk as one HFS+ partition

dos Entire disk as one DOS partition

raid Entire disk as one 0xAC partition


gdisk /dev/disk2
 

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
None of these commands will delete or erase any of my data right?
Debbies-MacBook-Air:~ debbiedavid$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *251.0 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage Debbie HD 250.1 GB disk0s2

3: Apple_Boot Recovery HD 650.1 MB disk0s3


/dev/disk1 (internal, virtual):

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Debbie HD +249.8 GB disk1

Logical Volume on disk0s2

962820F9-130B-4EBE-84E2-C92F432C6A3B

Unlocked Encrypted


/dev/disk2 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *2.0 TB disk2

1: 0xEE 2.0 TB disk2s1

@nacio i can't see my drive after i ran sudo fdisk -l

Keep getting this msg every time i plug my external drive in.... please help!!

The disk you inserted was not readable by this computer.

Initialize / Ignore / Eject
 

jonathanrparis

macrumors newbie
Jun 29, 2018
11
1
Debbies-MacBook-Air:~ debbiedavid$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *251.0 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage Debbie HD 250.1 GB disk0s2

3: Apple_Boot Recovery HD 650.1 MB disk0s3


/dev/disk1 (internal, virtual):

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Debbie HD +249.8 GB disk1

Logical Volume on disk0s2

962820F9-130B-4EBE-84E2-C92F432C6A3B

Unlocked Encrypted


/dev/disk2 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *2.0 TB disk2

1: 0xEE 2.0 TB disk2s1

@nacio i can't see my drive after i ran sudo fdisk -l

Keep getting this msg every time i plug my external drive in.... please help!!

The disk you inserted was not readable by this computer.

Initialize / Ignore / Eject

Can someone help me out? The main drive shows up on disk utility but not the volume (disk2s1).

When I run diskutil list it show up at 0XEE.

Can I run a terminal command to fix this?
 

lathm123

macrumors newbie
Jan 22, 2019
1
0
SOLVED: I solved the problem finally...

sudo fsck_exfat /dev/disk2s2
Password:
** Checking volume.
** Checking main boot region.
Main boot region is invalid. Trying alternate boot region.
** Checking alternate boot region.
** Checking system files.
** Volume name is AIMS Ext.
** Checking upper case translation table.
** Checking file system hierarchy.
** Checking active bitmap.
** Rechecking main boot region.
Main boot region needs to be updated.
Update? y
** Rechecking alternate boot region.
** The volume AIMS Ext was repaired successfully.

diskutil verifydisk disk2
Started partition map verification on disk2
Checking prerequisites
Checking the partition list
Checking the partition map size
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking the EFI system partition's folder content
Checking all HFS data partition loader spaces
Checking booter partitions
Checking Core Storage Physical Volume partitions
The partition map appears to be OK
Finished partition map verification on disk2

diskutil mount disk2s2
Volume AIMS Ext on disk2s2 mounted
[doublepost=1548215323][/doublepost]Hi I was hoping someone could help me. I followed the steps on this thread but got different results.
ExquisisteBeauty4ever:~ exquisitebeauty4ever$ sudo fsck_exfat /dev/disk2s2

Password:

** Checking volume.

** Checking main boot region.

Main boot region is invalid. Trying alternate boot region.

** Checking alternate boot region.

Alternate boot region is invalid.

** The volume could not be verified completely.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.