网站建设分金手指排名十一,重庆市建设执业注册中心网站,网站维护与推广定义,可以显示文章列表的wordpress主题首先最好添加一个空白的磁盘#xff0c;以免对原数据产生破坏#xff0c;若果不想添加磁盘也可以#xff0c;用一个里面数据无关紧要的磁盘#xff0c;当然前提是必须要对该磁盘内已有的分区进行清空#xff0c;方法后面第三步会有1.先看脚本内容#xff1a;[rootlocalho…首先最好添加一个空白的磁盘以免对原数据产生破坏若果不想添加磁盘也可以用一个里面数据无关紧要的磁盘当然前提是必须要对该磁盘内已有的分区进行清空方法后面第三步会有1.先看脚本内容[rootlocalhost shell]# cat auto_fdisk.sh#!/bin/bash#auto fdisk shellecho np1#这里的一个空格别忘了必不可少的这是创建分区时填写开始柱面时的Enter也就是使用默认柱面100Mnp2#一个空格200Mnp3#一个空格300Mne4#两个空格t382w | fdisk /dev/sdc这里我对/dev/sdc创建了3个大小分别为100M200M300M的主分区然后将剩余空间给了扩展分区并且将第三个分区类型调整为822.然后给该脚本赋予可执行权限最后执行执行结果是[rootlocalhost shell]# chmod x auto_fdisk.sh[rootlocalhost shell]# ./auto_fdisk.shDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0x0cf693d0.Changes will remain in memory only, until you decide to write them.After that, of course, the previous content wont be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)WARNING: DOS-compatible mode is deprecated. Its strongly recommended toswitch off the mode (command c) and change display units tosectors (command u).Command (m for help): Command (m for help): Command actione extendedp primary partition (1-4)Partition number (1-4): First cylinder (1-2349, default 1): Using default value 1Last cylinder, cylinders or size{K,M,G} (1-2349, default 2349):Command (m for help): Command actione extendedp primary partition (1-4)Partition number (1-4): First cylinder (15-2349, default 15): Using default value 15Last cylinder, cylinders or size{K,M,G} (15-2349, default 2349):Command (m for help): Command actione extendedp primary partition (1-4)Partition number (1-4): First cylinder (41-2349, default 41): Using default value 41Last cylinder, cylinders or size{K,M,G} (41-2349, default 2349):Command (m for help): Command actione extendedp primary partition (1-4)Selected partition 4First cylinder (80-2349, default 80): Value out of range.First cylinder (80-2349, default 80): Using default value 80Last cylinder, cylinders or size{K,M,G} (80-2349, default 2349): Using default value 2349Command (m for help): Partition number (1-5): Hex code (type L to list codes): Changed system type of partition 3 to 82 (Linux swap / Solaris)Command (m for help): The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.看一下执行结果[rootlocalhost shell]# fdisk -l /dev/sdcDisk /dev/sdc: 19.3 GB, 19327352832 bytes255 heads, 63 sectors/track, 2349 cylindersUnits cylinders of 16065 * 512 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0cf693d0Device Boot Start End Blocks Id System/dev/sdc1 1 14 112423 83 Linux/dev/sdc2 15 40 208845 83 Linux/dev/sdc3 41 79 313267 82 Linux swap / Solaris/dev/sdc4 80 2349 18233775 5 Extended3.最后如果想重新创建或者使开头提到的情况需要把一个已有分区清空可以这样[rootlocalhost shell]# dd if/dev/zero of/dev/sdc bs512 count110 records in10 records out512 bytes (512 B) copied, 0.0178267 s, 28.7 kB/s内核重新读取后再看一下此时的分区情况[rootlocalhost shell]# partprobeWarning: WARNING: the kernel failed to re-read the partition table on /dev/sdb (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.Error: Invalid partition table - recursive partition on /dev/sr0.[rootlocalhost shell]# fdisk -l /dev/sdcDisk /dev/sdc: 19.3 GB, 19327352832 bytes255 heads, 63 sectors/track, 2349 cylindersUnits cylinders of 16065 * 512 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000好了就是这样阅读(821) | 评论(0) | 转发(0) |