Comments Helpful Follow How to change the starting block of a partition inside the kickstart itself?

本文详细介绍了如何在Red Hat Enterprise Linux 5中通过Kickstart脚本修改分区起始扇区,实现从默认的63扇区更改为128扇区的方法。此操作对于硬盘的性能优化和数据读写效率提升具有重要意义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://access.redhat.com/solutions/44613

 

 

环境

  • Red Hat Enterprise Linux 5

问题

  • How to change the change the starting block of a partition inside the kickstart itself?

  • For example,  63 is the default. How to change it to 128.

    Raw

    $ /sbin/fdisk  -lu
    
    Disk /dev/sda: 160.0 GB, 160000000000 bytes
    255 heads, 63 sectors/track, 19452 cylinders, total 312500000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *          63      401624      200781   83  Linux
    /dev/sda2          401625   304303229   151950802+  8e  Linux LVM
    /dev/sda3       304303230   312496379     4096575   82  Linux swap / Solaris
    
    Disk /dev/sdb: 160.0 GB, 160000000000 bytes
    255 heads, 63 sectors/track, 19452 cylinders, total 312500000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *          63   312496379   156248158+  8e  Linux LVM
    

决议

Yes Partition alignment in kickstart is possible. To change the start sector from 63 to something like 128 or  similar check the below example kickstart script.

Raw

clearpart --none
part /boot --fstype ext3 --onpart=sda1
part pv.01 --onpart=sda2
volgroup myvg pv.01
logvol / --fstype ext3 --name=lv_root --vgname=myvg --size=4096 --grow
logvol swap --fstype swap --name=lv_swap --size=512 --vgname=myvg

%pre
DISK=/dev/sda
dd if=/dev/zero of=$DISK bs=1024 count=1
fdisk $DISK << EOF
n
p
1

+100M
x
b
1
128
w
EOF

fdisk $DISK << EOF
n
p
2


x
b
2
208848
w
EOF

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值