Repair broken OSX (HFS) volume after broken by BootCamp
 
Recently I made the mistake and formatted a partition on a hdd with only HFS+ volumes with my Windows 7 to NTFS. In Windows the result looked ok but OS X stopped being bootable. With a little trick booting from an existing OS X installation on an external drive I could fix this problem:

The command diskutil list gave me the following output:
/dev/disk0
  #:            TYPE NAME          SIZE    IDENTIFIER
  0:   GUID_partition_scheme            *128.0 GB  disk0
  1:            EFI             209.7 MB  disk0s1
  2:         Apple_HFS SYSTEM         118.6 GB  disk0s2
  3:         Apple_Boot Recovery HD       650.0 MB  disk0s3
  4:     Apple_CoreStorage             8.5 GB   disk0s4
  5:         Apple_Boot Boot OS X        134.2 MB  disk0s5
/dev/disk1
  #:            TYPE NAME          SIZE    IDENTIFIER
  0:   GUID_partition_scheme            *512.1 GB  disk1
  1:            EFI             209.7 MB  disk1s1
  2:    Microsoft Basic Data             338.5 GB  disk1s2
  3:         Apple_HFS Recovery HD       650.0 MB  disk1s3
  4:    Microsoft Basic Data             20.0 GB  disk1s4
  5:    Microsoft Basic Data             53.4 GB  disk1s5
  6:         Apple_Boot Recovery HD       650.0 MB  disk1s6
  7:    Microsoft Basic Data WINDATA         98.6 GB  disk1s7
/dev/disk2
  #:            TYPE NAME          SIZE    IDENTIFIER
  0:         Apple_HFS DATA          *8.1 GB   disk2


The magic did the command: sudo asr adjust --target /dev/disk1s2 --settype "Apple_HFS":

Fsck /dev/disk1s2 ....10....20....30....40....50....60....70....80....90....100
Adjust completed successfully
localhost:~ g4lp$ diskutil list
/dev/disk0
  #:            TYPE NAME          SIZE    IDENTIFIER
  0:   GUID_partition_scheme            *128.0 GB  disk0
  1:            EFI             209.7 MB  disk0s1
  2:         Apple_HFS SYSTEM         118.6 GB  disk0s2
  3:         Apple_Boot Recovery HD       650.0 MB  disk0s3
  4:     Apple_CoreStorage             8.5 GB   disk0s4
  5:         Apple_Boot Boot OS X        134.2 MB  disk0s5
/dev/disk1
  #:            TYPE NAME          SIZE    IDENTIFIER
  0:   GUID_partition_scheme            *512.1 GB  disk1
  1:            EFI             209.7 MB  disk1s1
  2:         Apple_HFS             338.5 GB  disk1s2
  3:         Apple_HFS Recovery HD       650.0 MB  disk1s3
  4:    Microsoft Basic Data             20.0 GB  disk1s4
  5:    Microsoft Basic Data             53.4 GB  disk1s5
  6:         Apple_Boot Recovery HD       650.0 MB  disk1s6
  7:    Microsoft Basic Data WINDATA         98.6 GB  disk1s7
/dev/disk2
  #:            TYPE NAME          SIZE    IDENTIFIER
  0:         Apple_HFS DATA          *8.1 GB   disk2



At this point, luckily the disk was mountable again:
diskutil mount readOnly /dev/disk1s2
Volume SYSTEM on /dev/disk1s2 mounted

Which made me able to do a full backup.


Later, I was able to use Disk Utility to repair the Volume and in special its partition table! Phew :-)
 
admin / Nov 01, 2014
   
 
 
Login: 
Pass: 
 
 
     
     
2004 - 2019 / lookass.ch
makememad@lookass.ch