gparted не будет работать на Ubuntu 14.04, на диске, который хорошо работает на Ubuntu 10.04
Рассматривая переход на Ubuntu 14.04, я попытался загрузить live dvd и посмотреть, как он видит настройки моего жесткого диска. На моей обычной установке 10.04 жесткий диск (который я настроил с помощью gparted) работает нормально:
$ parted /dev/sda
GNU Parted 2.2
Using /dev/sda
(parted) print
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 37.7GB 37.7GB ext3 boot
3 37.7GB 37.7GB 32.9MB bios_grub
2 37.7GB 3001GB 2963GB raid
(parted) quit
при загрузке до 14.04 gparted жалуется, что не может запросить диск, предлагая мне повторить попытку игнорирования или отмены, а затем показывает, что жесткий диск не настроен (не содержит разделов)
gdisk под 14.04 говорит, что таблица разделов повреждена. gdisk под 10.04 говорит, что таблица разделов в порядке.
Как это возможно, что одни и те же инструменты дают разные результаты на одном и том же оборудовании? Я даже пытался загрузиться с live dvd из Ubuntu 10.04, чтобы увидеть, вызвано ли это загрузкой с cd, но это не так. Диск выглядит нормально с 10.04, даже если он загрузился с DVD.
некоторые результаты от 14.04:
parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Invalid argument during seek for read on /dev/sda
Retry/Ignore/Cancel? c
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:
(parted) print
Error: Invalid argument during seek for read on /dev/sda
Retry/Ignore/Cancel? i
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? o
Model: ATA TOSHIBA DT01ACA3 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:
(parted) q
gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.8
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Command (? for help): q
`и на 10.04:
fdisk -l /dev/sda
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 267350 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.
root@user-desktop:~# gdisk /dev/sda
GPT fdisk (gdisk) version 0.5.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): q
4 ответа
Это неверное предположение, но может случиться так, что ваши диски используют функцию "Защищенная область хоста" (HPA), которая "скрывает" некоторые сектора диска. К сожалению, некоторые старые ядра Linux игнорировали HPA. Если вы разбили диск на части с таким ядром, более новое ядро (которое учитывает настройки HPA) показало бы, что диск внезапно стал меньше, чем старое ядро, и вы получите именно те симптомы, о которых вы сообщаете.
Чтобы проверить это, используйте hdparm
И его -N
вариант, как в:
$ sudo hdparm -N /dev/sda
/dev/sda:
max sectors = 488397168/488397168, HPA is disabled
В этом случае HPA отключается; но если он включен, вывод покажет этот факт. Если это то, что вы найдете, вы можете установить его правильно с помощью той же команды, но вы должны добавить p
и правильный размер, как в:
$ sudo hdparm -N p488397168
Вам придется корректировать передаваемое значение в зависимости от фактического размера вашего диска.
Я предполагаю: 10.4 настолько стар, что в инструментах раздела gpt были ошибки.
от http://en.wikipedia.org/wiki/History_of_hard_disk_drives
2010 - первый 3.0 терабайтный жесткий диск [23] [24] (Seagate, Western Digital)
2010 - первый жесткий диск, изготовленный с использованием расширенного формата из 4096 байт блока ("4K") вместо 512 байт блока [25] 2
Решение:
- получить новый диск,
- создавать новые таблицы и разделы с современными инструментами,
- переместите свои данные на новый диск.
извините за отсутствие лучшей идеи.
Хорошо. Спасибо всем, кто пытался помочь. Похоже, что это не имеет ничего общего с Ubuntu, и в основном это ошибка BIOS.
Некоторые материнские платы Gigabyte записывают копию своего BIOS на жесткие диски сразу после подключения дисков. Поэтому, просто подключив новый HD к материнской плате, вполне вероятно, что он будет записан, и HPA будет активирован, уменьшив размер диска. Ubuntu 10.04 по умолчанию игнорирует HPA (параметр ядра libata.ignore_hpa=1) и обрабатывает весь диск так, как если бы он не активировал HPA, используя все сектора диска. Ubuntu 14.04 по умолчанию учитывает HPA (параметр ядра libata.ignore_hpa=0) и поэтому обрабатывает диск так, как если бы он был меньше, чем есть на самом деле. Изначально диски были разбиты на 10.04 для общей суммы секторов. Смена кабеля привела к окончательной активации HPA на всех дисках RAID. Мне очень повезло, потому что оригинальный раздел не использовал все доступное пространство, но оставил достаточно места в конце диска для секторов, которые крала HPA. Я не знаю, почему, возможно, это было выравнивание с цилиндром до последнего. Обходной путь, к которому я пришел, заключался в перераспределении дисков так, как если бы они были меньше, чем они есть на самом деле, такими же большими, какими они были созданы HPA. Я загружаюсь до 14.04 и исправляю разделы с помощью gedit.
Процесс был очень опасным и мог потенциально уничтожить все мои данные. НЕ ПОВТОРЯЙТЕ ЕГО, ЕСЛИ ВЫ ЗАБОТИТЕСЬ О СОДЕРЖАНИИ ПРИВОДОВ.
После того, как я установил все три диска, обе ОС могли использовать raid, поэтому я фактически установил 14.04 на жесткий диск. Когда я загрузился в 10.04, утилиты разметки жаловались, что я не использую весь диск, но спрашивали, прежде чем что-то менять, так что никакого вреда не было. Чтобы исправить это небольшое неудобство, я добавил libata.ignore_hpa=0 в параметры ядра моего /etc/default/grub.conf для 10.04 и обновил grub.
Только ради истории, вот ОПАСНЫЙ процесс, который я использовал для преобразования схемы разбиения дисков в /dev/sda (она была одинаковой для всех дисков):
root@ubuntu:/cdrom/HPA_recovery# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.8
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Command (? for help): ?
b back up GPT data to a file
c change a partition's name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition's type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu
Command (? for help): r
Recovery/transformation command (? for help): ?
b use backup GPT header (rebuilding main)
c load backup partition table from disk (rebuilding main)
d use main GPT header (rebuilding backup)
e load main partition table from disk (rebuilding backup)
f load MBR and build fresh GPT from it
g convert GPT into MBR and exit
h make hybrid MBR
i show detailed information on a partition
l load partition data from a backup file
m return to main menu
o print protective MBR data
p print the partition table
q quit without saving changes
t transform BSD disklabel partition
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu
Recovery/transformation command (? for help): d
Recovery/transformation command (? for help): p
Disk /dev/sda: 5860531055 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2D50CD70-85F5-46FE-85B3-35A027E3C828
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 8-sector boundaries
Total free space is 5070 sectors (2.5 MiB)
Number Start (sector) End (sector) Size Code Name
1 34 73658024 35.1 GiB EF00
2 73722285 5860528064 2.7 TiB FD00
3 73658025 73722284 31.4 MiB EF02
Recovery/transformation command (? for help): x
Expert command (? for help): ?
a set attributes
c change partition GUID
d display the sector alignment value
e relocate backup data structures to the end of the disk
g change disk GUID
h recompute CHS values in protective/hybrid MBR
i show detailed information on a partition
l set the sector alignment value
m return to main menu
n create a new protective MBR
o print protective MBR data
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s resize partition table
t transpose two partition table entries
u Replicate partition table on new device
v verify disk
w write table to disk and exit
z zap (destroy) GPT data structures and exit
? print this menu
Expert command (? for help): e
Relocating backup data structures to the end of the disk
Expert command (? for help): ?
a set attributes
c change partition GUID
d display the sector alignment value
e relocate backup data structures to the end of the disk
g change disk GUID
h recompute CHS values in protective/hybrid MBR
i show detailed information on a partition
l set the sector alignment value
m return to main menu
n create a new protective MBR
o print protective MBR data
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s resize partition table
t transpose two partition table entries
u Replicate partition table on new device
v verify disk
w write table to disk and exit
z zap (destroy) GPT data structures and exit
? print this menu
Expert command (? for help): v
Caution: The CRC for the backup partition table is invalid. This table may
be corrupt. This program will automatically create a new backup partition
table when you save your partitions.
Caution: Partition 1 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.
Caution: Partition 2 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.
Caution: Partition 3 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.
Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
for information on disk alignment.
Identified 1 problems!
Expert command (? for help): x
a set attributes
c change partition GUID
d display the sector alignment value
e relocate backup data structures to the end of the disk
g change disk GUID
h recompute CHS values in protective/hybrid MBR
i show detailed information on a partition
l set the sector alignment value
m return to main menu
n create a new protective MBR
o print protective MBR data
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s resize partition table
t transpose two partition table entries
u Replicate partition table on new device
v verify disk
w write table to disk and exit
z zap (destroy) GPT data structures and exit
? print this menu
Expert command (? for help): p
Disk /dev/sda: 5860531055 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2D50CD70-85F5-46FE-85B3-35A027E3C828
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860531021
Partitions will be aligned on 8-sector boundaries
Total free space is 2957 sectors (1.4 MiB)
Number Start (sector) End (sector) Size Code Name
1 34 73658024 35.1 GiB EF00
2 73722285 5860528064 2.7 TiB FD00
3 73658025 73722284 31.4 MiB EF02
Expert command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.
root@ubuntu:/cdrom/HPA_recovery# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): q
Еще раз спасибо всем за помощь.
Другое решение:
Если ошибка известна, возможно, Ubuntu исправит таблицу разделов во время установки.
если нет, то по крайней мере сервер 10.4 еще не достиг конца своей жизни https://wiki.ubuntu.com/Releases
Найдите или отправьте сообщение об ошибке по адресу https://bugs.launchpad.net/ubuntu/
Но я боюсь, что они не найдут решение до конца жизни (30 апреля 2015 г.)
в любом случае вам понадобится место для создания резервной копии вашей системы. Таким образом, вам может понадобиться новый диск независимо от того, какое решение вы выберете.