parted 4k 对齐的问题

其它类软件,非上述版软件
回复
xiamingshi
帖子: 9
注册时间: 2011-11-27 12:48

parted 4k 对齐的问题

#1

帖子 xiamingshi » 2014-05-15 16:42

我新买的一个移动硬盘,采用GPT分区,前面0-33的扇区被GPT保留了,空闲空间从第34扇区开始,为了保证4k对齐,我想从第40扇区开始创建一个分区给 grub 用,但是执行

代码: 全选

mkpart primary 40s 2MiB


parted 却警告没有对齐,"Warning: The resulting partition is not properly aligned for best performance."
这是为什么?

代码: 全选

(parted) unit s print free                                                       
Model: WD Elements 1048 (scsi)
Disk /dev/sdb: 1953519616s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End          Size         File system  Name  Flags
        34s    1953519582s  1953519549s  Free Space

(parted) mkpart primary 40s 2MiB                                          
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? c                                                          
(parted) mkpart primary 40s 2MiB                                          
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? I                                                          
(parted) p                                                                
Model: WD Elements 1048 (scsi)
Disk /dev/sdb: 1953519616s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End    Size   File system  Name     Flags
 1      40s    4096s  4057s               primary
(parted) print free                                                       
Model: WD Elements 1048 (scsi)
Disk /dev/sdb: 1953519616s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End          Size         File system  Name     Flags
        34s    39s          6s           Free Space
 1      40s    4096s        4057s                     primary
        4097s  1953519582s  1953515486s  Free Space
You're never really done for as long as you've got a good story and someone to tell it to.
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: parted 4k 对齐的问题

#2

帖子 eexpress » 2014-05-15 22:44

既然有空闲空间,让系统的安装软件去决定嘛。为什么要手动? 还从扇区这低层的去算?
● 鸣学
头像
nyfair
帖子: 1067
注册时间: 2007-12-07 12:49
系统: winnux10
来自: Tree New Bee

Re: parted 4k 对齐的问题

#3

帖子 nyfair » 2014-05-21 13:48

请相信软件,不要相信自己。这种浅显的问题还做不到自动化,写这软件的人可以去死了
本人在此论坛仅负责吐槽,问题急需解决请支付宝转账5毛至{我的id@qq.com},将会竭诚为您服务

linux常见多媒体问题处理指南

1. 视频播放有问题->卸载gstreamer
2. 音频播放有问题->卸载pulseaudio
3. 远程播放有问题->卸载avahi
4. 系统全都有问题->卸载systemd,远离Lennart这傻逼让你从此轻松自在

⇩自由网络⇩
https://github.com/nyfair/freeweb
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: parted 4k 对齐的问题

#4

帖子 poloshiao » 2014-05-21 13:58

使用 Ubuntu Live USB/DVD 開機 登入試用桌面
終端機
gparted
重新分割
預設 MiB 為單位
只要 所有的 分割區 起點 / 終點 都選 整數 不要有 小數
分割完成的 分割表
自然就支援 4k 对齐
回复