VirtualBox 安装Linux 虚拟机添加磁盘

在这里插入图片描述
建立分区
fdisk 是一款强大的磁盘操作工具,来自util-linux软件包,使我们在文件系统管理过程中使用的极为频繁的一个指令,我们可以用它查看磁盘分区表以及分区结构,同时能够利用它进行磁盘分区。使用起来很简单,一般只有一个参数-l

fdisk [–l] 设备名称
=>fdisk最常用的一个参数,输出整个系统内的设备分区。若有多个设备,则可以输出指定设备的分区信息
[root@server ~]# fdisk –l
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sda1 * 1 25 200781 83 Linux

在上面显示的数据中:
第一行sd表示系统使用的是SCSI硬盘,a则表示系统的第一块硬盘,如果还有第二块则是sdb,以此类推。,接下来就表示硬盘的容量了。
第二行 表示硬盘有255个磁头,63个扇区,2610个柱面,利用我们上面所学的磁盘容量计算公式,大家能不能自己算算这个硬盘的容量呢?
磁盘容量=2556338913 *512(Bytes).大家自己试试看。
第三行则显示每个柱面的大小。
下面各列的含义为:
Device:设备名称
Boot:表示否为开机引导模块。
Start:分区起始柱面。
End:分区结束柱面。
Blocks:以1K为单位的容量。
ID,System:表示这个分区内的文件系统式什么?不过这里通常只是一个提示而已,不见得一定代表此分区类型。
除了列出硬盘的分区信息,fdisk还可以用于系统分区。

fdisk /dev/sda =>fdisk直接接设备名,小心别接数字,不针对分区。

The number of cylinders for this disk is set to 38913.
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)

Command (m for help): =>在此处输入操作指令,输入?显示能够输入的指令
Command (m for help): ?
?: unknown command
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 =>改变分区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): p

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 15323 1228

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值