Linux利用fdisk工具建立分区的方法


当Linux系统硬盘还有不少空间的时候,我们能够使用fdisk工具对系统进行分区,以满足个人需求,那么fdisk工具要如何使用呢?下面小编就给大家介绍下Linux使用fdisk建立分区的方法,感兴趣的朋友可以来了解下。

首先查看硬盘信息

fdisk -l 如果有硬盘有剩余空间就可以对其进行分区

[root@bogon 桌面]# fdisk -l

Disk /dev/sda: 85.9 GB, 85899345920 bytes

255 heads, 63 sectors/track, 10443 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000471ad

Device Boot Start End Blocks Id System

/dev/sda1 * 1 26 204800 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 26 3851 30720000 83 Linux

/dev/sda3 3851 4106 2048000 82 Linux swap / Solaris

/dev/sda4 4106 10444 50912256 5 Extended

/dev/sda5 4106 10444 50911232 83 Linux

Disk /dev/sdb: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

#从上面看出/dev/sda空间已经用完了,/dev/sdb没有使用。

下面我们对/dev/sdb 进行分区

[root@bogon 桌面]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0xfaa2aa49.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won‘t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to

switch off the mode (command ‘c’) and change display units to

sectors (command ‘u’)。

Command (m for help): 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 partition‘s system id

u change display/entry units

v verify the partition table

w write table to disk and exit

x extra functionality (experts only)


上一篇:没有了

下一篇:CentOS 6.2升级yum时提示libotf.so.0错误如何办?


Linuxfdisk分区 Linuxfdisk分区教程 fdisk分区
Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器