linux格式化后磁头数变成255,11.Linux磁盘分区格式化和挂载.docx

11.Linux磁盘分区格式化和挂载

管理磁盘和文件系统:管理磁盘及分区在linux服务器中,当现有硬盘的分区规划不能满足要求时,就需要对硬盘中的分区进行重新规划和调整,有时候还需要添加新的硬盘设备来扩展存储空间。实现上述操作需要用到fdisk磁盘及分区管理工具,fdisk是大部分linux自带的基本工具之一。硬盘使用过程需要先分区,再格式化,在挂载到系统指定目录才可使用。检测并确认新硬盘:加入新硬盘后,linux系统会自动检测并加载该硬盘。执行fdisk -l命令可以进行查看,确认新硬盘设备名称:Fdisk –l命令的作用是列出当前系统中所有硬盘设备及其分区的信息。[root@localhost ~]# fdisk–lDecive :分区的设备文件名称.Boot :是否是引导分区,是,则有”*”标识。Start :该分区在硬盘中的起始位置。End :该分区在硬盘中的结束位置。Blocks :分区的大小,块为单位。Id :分区类型的ID标记号,EXT3为83,LVM为8e。System :分区类型。规划分区:在硬盘设备中创建,删除,更改分区等操作同样通过fdisk命令进行。命令:fdisk +设备文件名(/dev/sdb)进入交互式的分区管理界面。为新硬盘创建,删除,更改分区命令:fdisk +设备文件名(/dev/sdb)[root@localhost ~]# fdisk /dev/sdb(sdb新加的硬盘)Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0x5253063c.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 toswitch off the mode (command 'c') and change display units tosectors (command 'u').Command (m for help): m (输入m帮助信息)Command actiona toggle a bootable flagb edit bsd disklabelc toggle the dos compatibility flag d delete a partition (d :删除分区)l list known partition typesm print this menu n add a new partition (n :创建分区)o create a new empty DOS partition table p print the partition table (p :列出硬盘中的分区情况) q quit without saving changes(q :不保存配置退出操作)s create a new empty Sun disklabel t change a partition's system id (t :变更分区类型)u change display/entry unitsv verify the partition table w write table to disk and exit (w :保存配置退出)x extra functionality (experts only)Command (m for help): n (n创建分区)Command action e extended(e创建扩展分区) p primary partition (1-4)(p创建主分区,序号只能在1-4之间)p (p选择创建主分区)Partition number (1-4): 1(设置第一个主分区的编号为1)First cylinder (1-2610, default 1): (直接回车选择默认)Using default value 1Last cylinder,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值