Seagate 7200.14 3Tb HDD под Gentoo с секторами 4k

Материал из AlexNook
Перейти к навигацииПерейти к поиску

Подошёл как-то момент, что мне стало не хватать установленных жёстких дисков в компьютере. Количество информации увеличивалось и я подумал о приобретении нового hdd. Выбор пал на новинку в то время - Seagate Barracuda 3000Gb ST3000DM001 7200.14. Ещё до покупки я понял, что при его установке придётся повозиться с его форматированием, так что описанные ниже действия не стали для меня неожиданностью.

Предварительная установка ПО

Т. к. на этом диске планировалось хранение данных, то разбиение на разделы не предусматривалось, всё что требовалось это настройка 3Tb диска с Advanced Format Technology под Gentoo c 1 разделом, отформатированным под XFS.

Сперва посмотрим, что у нас отобразилось в dmesg:

dmesg | egrep 'ata5|sd 4|sdd'
ata5: SATA max UDMA/133 abar m2048@0xbfffe800 port 0xbfffeb00 irq 19
sd 3:0:0:0: [sdd] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
sd 3:0:0:0: [sdd] 4096-byte physical blocks
sd 3:0:0:0: [sdd] Write Protect is off
sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00
.....

Не смотря на то, что физические сектора на диске имеют размер по 4096 байт, логические сектора отображены как 512 байт.

Далее необходимо проверить, всё ли верно сконфигурированно в ядре (далее приведу образец не совсем своего конфига, но сделать можно по аналогии):

Linux Kernel Configuration: 2.6.38 kernel config
Enable the block layer (BLOCK)  ---> 
		[*] Support for large (2TB+) block devices and files (LBDAF) 
File systems  ---> 
		[*] The Extended 4 (ext4) filesystem 
		Partition Types  ---> 
			[*] Advanced Partition Selection (PARTITION_ADVANCED)  ---> 
				[*] EFI GUID Partition Support (EFI_PARTITION)


Note: LBDAF опция будет лишь в 32-х битных системах. У меня её не было, т. к. система 64 битная. Так же я не включал драйверы ext4, т. к. использую XFS.

Для верной разметки диска нам понадобится создать на нём GUID Partition Table (GPT), т. к. диск наш объёмом в 3Тб. Для этого ставим программу GPT fdisk

emerge sys-apps/gptfdisk
Note: Я буду использовать самую новыую на тот момент времени версию программы - 0.6.13

Далее ради интереса решил проверить, что выдаст старый добрый fdisk:

Disk /dev/sdd: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/sdd doesn't contain a valid partition table

Разметка диска 3Tb advanced format 4k sectors

Запускаем gdisk

gdisk /dev/sdd

Далее я помещу целиком весь лог работы с программой, а ниже дам комментарии по командам:

router_a alex # gdisk /dev/sdd
GPT fdisk (gdisk) version 0.6.13

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.

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): 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): d
Partitions will begin on 2048-sector boundaries.

Expert command (? for help): l 8
Enter the sector alignment value (1-65536, default = 2048): 8

Expert command (? for help): d
Partitions will begin on 8-sector boundaries.

Expert command (? for help): m

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-5860533134, default = 34) or {+-}size{KMGTP}:
Information: Moved requested sector from 34 to 40 in
order to align on 8-sector boundaries.
Use 'l' on the experts' menu to adjust alignment
Last sector (40-5860533134, default = 5860533134) or {+-}size{KMGTP}: 5860533127
Current type is 'Linux/Windows data'
Hex code or GUID (L to show codes, Enter = 0700):
Changed type of partition to 'Linux/Windows data'

Command (? for help): i
Using 1
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Linux/Windows data)
Partition unique GUID: 14D31C05-5E8F-4120-AE5C-5EE2DB6DFC4C
First sector: 40 (at 20.0 KiB)
Last sector: 5860533127 (at 2.7 TiB)
Partition size: 5860533088 sectors (2.7 TiB)
Attribute flags: 0000000000000000
Partition name: Linux/Windows data

Command (? for help): c
Using 1
Enter name: FILMS

Command (? for help): p
Disk /dev/sdd: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 5556F0B6-6FEF-458A-917C-2023E9AEE0A6
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 13 sectors (6.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40      5860533127   2.7 TiB     0700  FILMS

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed, possibly destroying your data? (Y/N): y
OK; writing new GUID partition table (GPT).
The operation has completed successfully.







Ссылки

Постарался собрать все полезные ссылки, которыми пользовался.

  • 4k sectors partitioning question
  • WD Advanced Format Drive on a non-Windows Operating System
  • Linux on 4KB-sector disks
  • 4K sector partition in Gentoo
  • GDISK man page
  • align check command
  • Paragon о выравнивании разделов на дисках под 4k