你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux下分区详解之--Fdisk

[日期:2012-05-06] 来源:Linux社区  作者:吴伟龙 [字体:大 中 小]

通过fdisk命令来来修改现有分区类型

   Fdisk 通过t参数来指定

 查看分区类型

[root@ www.linuxidc.com ~]# fdisk -l /dev/sdb   查看分区信息,类型是Linux,id是83

 

Disk /dev/sdb: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280bytes

 

  Device Boot      Start         End      Blocks  Id  System

/dev/sdb1               1        1024    8225248+  83  Linux

/dev/sdb2            1025        2000    7839720   83  Linux

 

修改分区类型

[root@ www.linuxidc.com ~]# fdisk /dev/sdb

 

The number of cylinders for this disk isset to 2610.

There is nothing wrong with that, but thisis larger than 1024,

and could in certain setups cause problemswith:

1) software that runs at boot time (e.g.,old versions of LILO)

2) booting and partitioning software fromother OSs

  (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): t                              ---进入修改分区类型

Partition number (1-4): 1                              ---指定需要修改的分区号

Hex code (type L tolist codes): 6                        ---指定分区号为6,也就是FAT16

注意:查看分区类型的代码,在这里可以输入L查看就可以了

Changed system type of partition 1 to 6(FAT16)

 

Command (m for help): w                              ---保存

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition tablefailed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the nextreboot.

 

WARNING: If you have created or modifiedany DOS 6.x

partitions, please see the fdisk manualpage for additional

information.

Syncing disks.

 

[root@ www.linuxidc.com ~]# fdisk -l /dev/sdb        ---我们看到已经FAT16,并且ID也改成6了。

 

Disk /dev/sdb: 21.4 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280bytes

 

  Device Boot      Start         End      Blocks  Id  System

/dev/sdb1               1        1024    8225248+   6  FAT16

/dev/sdb2            1025        2000    7839720   83  Linux

[root@ www.linuxidc.com ~]#

linux
相关资讯       Linux入门教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款