Монтирование раздела HFS + в Arch Linux

20431
ZuluDeltaNiner

У меня проблемы с монтированием раздела hfs + в Arch Linux.

Когда я бегу, sudo mount -t hfsplus /dev/sda2 /mnt/macя получаю эту ошибку:

mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error  In some cases useful info is found in syslog - try dmesg | tail or so. 

Бег dmesg | tailдает:

[ 6645.183965] cfg80211: Calling CRDA to update world regulatory domain [ 6648.331525] cfg80211: Calling CRDA to update world regulatory domain [ 6651.479107] cfg80211: Calling CRDA to update world regulatory domain [ 6654.626663] cfg80211: Calling CRDA to update world regulatory domain [ 6657.774207] cfg80211: Calling CRDA to update world regulatory domain [ 6660.889864] cfg80211: Calling CRDA to update world regulatory domain [ 6664.007521] cfg80211: Exceeded CRDA call max attempts. Not calling CRDA [ 6857.870580] perf interrupt took too long (2503 > 2495), lowering kernel.perf_event_max_sample_rate to 50100 [11199.621246] hfsplus: invalid secondary volume header [11199.621251] hfsplus: unable to find HFS+ superblock 

Есть ли способ смонтировать этот раздел?

РЕДАКТИРОВАТЬ :

Использование sudo mount -t hfsplus -o ro,loop,offset=409640,sizelimit=879631488 /dev/sda2 /mnt/macизбавляется от hfsplus: invalid secondary volume headerвdmesg | tail

18

2 ответа на вопрос

29
Stewart Adam

It's likely that the HFS volume is not mounting because the HFS partition is wrapped in a CoreStorage volume (the default since OS X 10.10). You can verify if this is the case with the output of fdisk -l: fdisk output

HFS+ uses two volume headers, one 1024 into the device and the secondary 1024 from the end of the device. Per the spec, when mounting a partition the secondary header is expected to be to be exactly 1024 bytes from the partition's end, but with CoreStorage wrapping the HFS volume that's no longer the case so it aborts. You can pass -o sizelimit=N to mount to manually specify the HFS volume size and fix this, but how does one get the magic value for N?

The testdisk utility can scan for partitions, hinting at where the HFS partition really ends. Be wary - selecting the wrong options in testdisk can damage your partition table!

  1. Launch TestDisk with testdisk /dev/sdX, and then OK to select the drive
  2. Select Intel for MBR or EFI GPT for GPT formatted drives
  3. Press Analyse and then Quick Search
  4. After a few moments it should print it the partitions found: testdisk results

    The partition indicated looks awfully close to (but slightly smaller) than the real partition size of 623463232 sectors reported by fdisk -l earlier.

    Because the TestDisk output uses sectors, we'll need to multiply it by the drive's logical sector size (typically 512 or 4096 bytes) to get the HFS volume size in bytes. That's the value for N we'll use for -o sizelimit=N when mounting the HFS volume.

    If you don't know your drive's logical sector size, check the output of the second first number reported by fdisk -l on the line shown below: finding your disk's logical sector size

  5. Press q several times to exit the program

  6. Mount the disk: mount /dev/sdXn -t hfsplus -o ro,sizelimit=N
От пользователя [edmonde] (http://superuser.com/users/614222/edmonde): Этот рецепт отлично работал для меня, но мне пришлось настроить его, используя размер логического сектора (первое из двух чисел, в моем случае 512 против 4096) в отличие от размера физического сектора для расчета общего размера тома. Я не уверен, почему, но это работало отлично. fixer1234 7 лет назад 3
Это исправило мою проблему. Другие ресурсы предложили использовать параметр `offset`, который не работал в сочетании с этим, но с использованием _only_` sizelimit`, установленного на число байтов (байтов * секторов), работавших как шарм, даже для разделов не-CoreStorage cdeszaq 7 лет назад 0
Это не работает для меня. Я получаю `mount fail: Unknown error -1` и ничего в` dmesg`. `hfsplus` определенно загружен. Dan 6 лет назад 0
+1 исправлено с помощью размера логического сектора Jake 6 лет назад 0
1
Cory T

Другой вариант - избавиться от CoreStorage, если вам доступна машина с OS X. Это также избавит от дешифрования, если вы используете его, и вам придется подождать, пока расшифровка не будет завершена (подключено к питанию и загружено в OS X, даже восстановление).

Вам нужно будет загрузиться с диска, который вам не подходит, желательно с восстановлением через Интернет (если доступно, command-option-r при перезагрузке). Откройте терминал и выполните:

diskutil cs list 

Вывод должен показать ваши тома CoreStorage и все, одним из них является его статус Revertible. Если это означает Да, то вы будете в хорошей форме, чтобы продолжить. Далее вы запустите:

diskutil cs revert /dev/ diskXsY 

(Где X - номер диска, а Y - номер раздела).

После этого вы можете проверить его состояние с помощью той же команды «diskutil cs list». Если он не был зашифрован, он должен вернуться к стандартной компоновке раздела GPT, и вы можете попытаться снова смонтировать его в Arch. Он все еще должен регистрироваться в журнале, который останется доступным только для чтения, если вы хотите переключиться, что вы можете сделать это в Дисковой утилите.

Если он был зашифрован, процесс займет некоторое время, но «diskutil cs list» покажет вам прогресс в процентах.

У меня не было проблем с монтированием не ArchiStorage HFS + дисков и разделов на Arch. В конце концов я переместил данные, переделил их как ext4 и вернул данные обратно к ним.

Похожие вопросы