本文主要是介绍脚本乐园 磁盘自动化均等分区demo,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
磁盘自动化均等分区:<span style="font-family:Courier New;font-size:12px;">#!/usr/bin/env shset -efunction help()
{echo "Usage: create_disk_partition <dev-name> <partition-num>"echo "Help options:"echo " <dev-name> the name of disk-dev , /dev/sde"echo " <partition-num> the total num of partition"echo " -h|? :Show this help message"}dev_name=/dev/sde
part_num=36
cylinders_per=0
function format_disk_prepare()
{toatl_cylinders=`fdisk -l $dev_name | grep "sectors/track" | awk '{print$5}'` cylinders_per=`expr $toatl_cylinders / $part_num`cylinders_per=`expr $cylinders_per - 1`echo "Clear $dev_name data!"echo ""echo "one1w"|fdisk $de
这篇关于脚本乐园 磁盘自动化均等分区demo的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!