通过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 ~]#
