LINUX.ORG.RU

512e or 4K ?

 , , ,


0

2

Решил я привести в порядок свой жествий диск, переразметить из MBR в GPT и т.д. Снёс все разделы, решил поставить в дуалбут Win10 и ArchLinux. Поставил изделие от M$, начинаю ставить арчик и вижу следующий вывод fdisk:

fdisk -l /dev/sda                                                                                                                                                                                                    :(
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: gpt
Disk identifier: 2FD06E93-05ED-4501-87B5-5A037DC1FDE8

Device         Start        End    Sectors   Size Type
/dev/sda1       2048     923647     921600   450M Windows recovery environment
/dev/sda2     923648    1128447     204800   100M EFI System
/dev/sda3    1128448    1161215      32768    16M Microsoft reserved
/dev/sda4    1161216  419432447  418271232 199.5G Microsoft basic data
/dev/sda5  419432448 2160232447 1740800000 830.1G Microsoft basic data

1. Означает ли это что винда по умолчанию использует 512E вместо 4KN со всеми вытикающими(производительность и износ)?

2. Можно ли средствами linux сделать на диске 4KN без потери данных?



Последнее исправление: napukmaxep (всего исправлений: 1)

  1. 512e или 4Kn ты никак не выбираешь, это просто свойство диска;
  2. 512e использует read-modify-write только для невыровненных записей, которых у тебя почти никогда не будет, поэтому не скажется на производительности.
i-rinat ★★★★★
()

https://unix.stackexchange.com/questions/178899/optimizing-logical-sector-siz...

512 byte is not really the default sector size. It depends on you hardware.

You can display what physical/logical sector sizes your disk reports via the /sys pseudo filesystem, e.g.:

# cat /sys/block/sda/queue/physical_block_size
4096
# cat  /sys/block/sda/queue/logical_block_size
512
What is the difference between those two values? The physical_block_size is the minimal size of a block the drive is able to write in an atomic operation, and the logical_block_size is the smallest size the drive is able to write (cf. the linux kernel documentation). Thus, if you have a 4k drive it makes sense that your storage stack (filesystem etc.) uses something equal or greater than the physical sector size.

Those values are also displayed in recent versions of fdisk, e.g.:

# fdisk -l /dev/sda
[..]
Sector size (logical/physical): 512 bytes / 4096 bytes
On current linux distributions, programs (that should care about the optimal sector size) like mkfs.xfs will pick the optimal sector size by default (e.g. 4096 bytes).

But you can also explicitly specify it via an option, e.g.:

# mkfs.xfs -f -s size=4096 /dev/sda
Or:

# mkfs.ext4 -F -b 4096 /dev/sda
In any case, most mkfs variants will also display the used block size during execution.

For an existing filesystem the block size can be determined with a command like:

# xfs_info /mnt
[..]
meta-data=                       sectsz=4096
data     =                       bsize=4096
naming   =version 2              bsize=4096
log      =internal               bsize=4096
         =                       sectsz=4096
realtime =none                   extsz=4096
Or:

# tune2fs -l /dev/sda
Block size:               4096
Fragment size:            4096
mandala ★★★★★
()
Последнее исправление: mandala (всего исправлений: 1)

тут правильно говорят
4 килобайта - это стандарт

kto_tama ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.