Linux下fdisk使用方法.docx_第1页
Linux下fdisk使用方法.docx_第2页
Linux下fdisk使用方法.docx_第3页
Linux下fdisk使用方法.docx_第4页
Linux下fdisk使用方法.docx_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Linux下fdisk使用方法理论知识:一块磁盘最多有4个分区,包括(主分区+扩展分区),扩展分区不能直接使用,需进行分区为逻辑分区,其数字从5开始。首先在未开机前添加一块磁盘,然后开机。rootwangbin # fdisk l / 查看磁盘分区情况Disk /dev/sda: 42.9 GB, 42949672960 bytes255 heads, 63 sectors/track, 5221 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 25 200781 83 Linux /系统引导分区/dev/sda2 26 286 2096482+ 82 Linux swap / Solaris /交换分区/dev/sda3 287 5221 39640387+ 83 LinuxDisk /dev/sdb: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 1217 9775521 83 Linux/dev/sdb2 1218 2434 9775552+ 83 LinuxDisk /dev/sdc: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdc doesnt contain a valid partition table / /dev/sdc磁盘没有有效的分区表,说明没有进行分区。rootwangbin # fdisk /dev/sdc /对 /dev/sdc进行分区Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent wont be recoverable.The number of cylinders for this disk is set to 2610.There is nothing wrong with that, but this is larger than 1024,and could in certain setups cause problems with:1) software that runs at boot time (e.g., old versions of LILO)2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): m /输入m得到帮助信息Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition / 删除分区 l list known partition types m print this menu n add a new partition /增加分区 o create a new empty DOS partition table p print the partition table /打印分区 q quit without saving changes /不保存退出 s create a new empty Sun disklabel t change a partitions system id u change display/entry units v verify the partition table w write table to disk and exit /保存退出 x extra functionality (experts only)Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First cylinder (1-2610, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): +500MCommand (m for help): pDisk /dev/sdc: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdc1 1 62 497983+ 83 LinuxCommand (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 2First cylinder (63-2610, default 63): Using default value 63Last cylinder or +size or +sizeM or +sizeK (63-2610, default 2610): +500MCommand (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 3First cylinder (125-2610, default 125): Using default value 125Last cylinder or +size or +sizeM or +sizeK (125-2610, default 2610): +500MCommand (m for help): nCommand action e extended p primary partition (1-4)eSelected partition 4First cylinder (187-2610, default 187): Using default value 187Last cylinder or +size or +sizeM or +sizeK (187-2610, default 2610): Using default value 2610Command (m for help): pDisk /dev/sdc: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdc1 1 62 497983+ 83 Linux/dev/sdc2 63 124 498015 83 Linux/dev/sdc3 125 186 498015 83 Linux/dev/sdc4 187 2610 19470780 5 Extended /扩展分区Command (m for help): nFirst cylinder (187-2610, default 187): Using default value 187Last cylinder or +size or +sizeM or +sizeK (187-2610, default 2610): +500MCommand (m for help): nFirst cylinder (249-2610, default 249): Using default value 249Last cylinder or +size or +sizeM or +sizeK (249-2610, default 2610): +500MCommand (m for help): nFirst cylinder (311-2610, default 311): Using default value 311Last cylinder or +size or +sizeM or +sizeK (311-2610, default 2610): +500MCommand (m for help): pDisk /dev/sdc: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdc1 1 62 497983+ 83 Linux/dev/sdc2 63 124 498015 83 Linux/dev/sdc3 125 186 498015 83 Linux/dev/sdc4 187 2610 19470780 5 Extended/dev/sdc5 187 248 497983+ 83 Linux/dev/sdc6 249 310 497983+ 83 Linux/dev/sdc7 311 372 497983+ 83 LinuxCommand (m for help): dPartition number (1-7): 7Command (m for help): pDisk /dev/sdc: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdc1 1 62 497983+ 83 Linux/dev/sdc2 63 124 498015 83 Linux/dev/sdc3 125 186 498015 83 Linux/dev/sdc4 187 2610 19470780 5 Extended/dev/sdc5 187 248 497983+ 83 Linux/dev/sdc6 249 310 497983+ 83 LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.rootwangbin # partprobe /使分区生效Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened read-only.rootwangbin # fdisk -l /dev/sdc /查看/dev/sdc的分区Disk /dev/sdc: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdc1 1 62 497983+ 83 Linux/dev/sdc2 63 124 498015 83 Linux/dev/sdc3 125 186 498015 83 Linux/dev/sdc4 187 2610 19470780 5 Extended/dev/sdc5 187 248 497983+ 83 Linux/dev/sdc6 249 310 497983+ 83 Linuxrootwangbin # mkfs.ext3 /dev/sdc1 对/dev/sdc1进行格式化mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=1024 (log=0)Fragment size=1024 (log=0)124928 inodes, 497980 blocks24899 blocks (5.00%) reserved for the super userFirst data block=1Maximum filesystem blocks=6763315261 block groups8192 blocks per group, 8192 fragments per group2048 inodes per groupSuperblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409Writing inode tables: done Creating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 38 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.rootwangbin # mkfs.ext3 /dev/sdc2 /对/dev/sdc2进行格式化rootwangbin # mkfs.ext3 /dev/sdc3 /对/dev/sdc3进行格式化rootwangbin # mkfs.ext3 /dev/sdc5 /对/dev/sdc5进行格式化rootwangbin # mkfs.ext3 /dev/sdc6 /对/dev/sdc6进行格式化rootwangbin # mkdir -p /sdc/sdc1 /创建/sdc/sdc1目录rootwangbin # mkdir -p /sdc/sdc2rootwangbin # mkdir -p /sdc/sdc3rootwangbin # mkdir -p /sdc/sdc5rootwangbin # mkdir -p /sdc/sdc6rootwangbin # mount /dev/sdc1 /sdc/sdc1 /将/sdc/sdc1挂载到/dev/sdc1rootwangbin # mount /dev/sdc2 /sdc/sdc2rootwangbin # mount /dev/sdc3 /sdc/sdc3rootwangbin # mount /dev/sdc5 /sdc/sdc5rootwang

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论