Blog Pro de Jean-Baptiste HEREN - Tag - disk repair Notes d'un consultant Freelance en Informatique 2015-11-03T21:34:19+01:00 JB HEREN urn:md5:e39389b5ec134d99645112fce3d957df Dotclear Repair HFS+ Volume on OSX urn:md5:e1b4e2647fe8360f4699e9cc1cbc01be 2011-02-09T00:26:00+01:00 2011-02-09T07:14:26+01:00 Jean-Baptiste Heren Linux disk repairfsckhfsplusMacOSXsnow leopard <p><img src="http://blog.jbheren.com/public/tuto/OSX/.harddrive_osx_m.jpg" alt="harddrive_osx.png" style="float:left; margin: 0 1em 1em 0;" title="harddrive_osx.png, fév. 2011" />Yesterday I had a little surprise on one of my disks (the backup one.Disk utility was unable to repair it, but here you will find some tips</p> <h2>1- read your disk with Linux</h2> <p>Boot on <a href="http://www.ubuntu.com/desktop/get-ubuntu/download" hreflang="en">Ubuntu live CD</a> and try to open your disk. It will mount read-only (default for HFS) but you will be able to grab most of your files to a network or FAT external drive. This saved my life a couple of times.</p> <h2>2- repair with fsck on OSX</h2> <p>Fsck is also available on OSX. Let's open your terminal. On the following commands, replace /dev/disk1s2 with the location of your disk's partition.</p> <h3>2.1 - run a diagnostc</h3> <pre>[script] MyMac:~ jb$ fsck -fy /dev/disk1s2 ** /dev/rdisk1s2 BAD SUPER BLOCK: MAGIC NUMBER WRONG LOOK FOR ALTERNATE SUPERBLOCKS? yes SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE -b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8). </pre> <h3>2.2 - repair by adding the r option</h3> <p>This can take a while, it took 60min for my 1,5TB Disk.</p> <pre>[script] MyMac:~ jb$ fsck_hfs -fy /dev/disk1s2 ** /dev/rdisk1s2 Executing fsck_hfs (version diskdev_cmds-491.3~2). ** Checking Journaled HFS Plus volume. ** Checking extents overflow file. ** Checking catalog file. Invalid node structure (4, 242826) ** The volume Grozor could not be verified completely. iMac-de-la-familia:~ jb$ fsck_hfs -ypr /dev/disk1s2 Executing fsck_hfs (version diskdev_cmds-491.3~2). ** Checking Journaled HFS Plus volume. ** Checking extents overflow file. ** Checking catalog file. ** Rebuilding catalog B-tree. Invalid node structure (4, 242826) Invalid record count (4, 242827) Invalid record count (4, 242828) Invalid record count (4, 242829) Invalid record count (4, 242830) Invalid record count (4, 242831) ** Rechecking volume. ** Checking Journaled HFS Plus volume. ** Checking extents overflow file. ** Checking catalog file. Missing thread record (id = 47443244) Incorrect number of thread records (4, 21586) Incorrect number of thread records (4, 21586) ** Checking multi-linked files. Incorrect number of file hard links ** Checking catalog hierarchy. Invalid directory item count (It should be 428 instead of 440) Missing thread record (id = 47443242) Invalid directory item count (It should be 0 instead of 1) Invalid directory item count (It should be 107 instead of 440) Invalid directory item count (It should be 673621 instead of 673646) Invalid volume file count (It should be 4308261 instead of 4309339) ** Checking extended attributes file. Incorrect number of extended attributes (It should be 1823295 instead of 1823257) Incorrect number of Access Control Lists (It should be 1823272 instead of 1823234) ** Checking multi-linked directories. Incorrect number of directory hard links ** Checking volume bitmap. Volume bitmap needs minor repair for orphaned blocks ** Checking volume information. Invalid volume free block count (It should be 19453978 instead of 7705538) Volume header needs minor repair (2, 0) ** Repairing volume. ... </pre> <p>If your drive is sill not repaired :</p> <pre>[script] Invalid first link in hard link chain (id = 47694526) (It should be 49482808 instead of 49484125) ** Look for missing items in lost+found directory. ** The volume Grozor could not be repaired. </pre> <p>Then you can try to fix it again with your Disk utilities (Application/utilities) <img src="http://blog.jbheren.com/public/tuto/OSX/.utilitaire_disques_m.jpg" alt="utilitaire_disques.png" style="float:right; margin: 0 0 1em 1em;" title="utilitaire_disques.png, fév. 2011" /></p> <p>Then if you are as lucky than I was, you will be able to mount under OSX. Now it is wise to backup important files (if not already done) and run a physical test.</p>