关于 Linux下硬盘分区的操作步骤分享

 2023-12-25  阅读 4  评论 0

摘要:要掌握Linux硬盘的分区,还得明白了MBR、存储分区和逻辑分区的概念,今天小编就给大家能介绍下Linux硬盘分区的详细点步骤,有兴趣的朋友不如来了解下吧。 \\1、查看硬盘大小,并硬盘分区。 [root@colud~]#fdisk-l\\Disk/dev/sda:10.7GB,10737418240bytes 255heads,63sectors

关于 Linux下硬盘分区的操作步骤分享

要掌握Linux硬盘的分区,还得明白了MBR、存储分区和逻辑分区的概念,今天小编就给大家能介绍下Linux硬盘分区的详细点步骤,有兴趣的朋友不如来了解下吧。

\\1、查看硬盘大小,并硬盘分区。

[root@colud~]#fdisk-l\\Disk/dev/sda:10.7GB,10737418240bytes

255heads,63sectors/track,1305cylinders

Units=cylindersthe16065*512=8225280bytes

Sectorsize(logical/behavioral):512bytes/512bytes

I/Osize(optimal/optimal):512bytes/512bytes

Diskidentifier:0x000c16ac\\DeviceBootStartEndBlocksIdSystem

/dev/sda1*16451200083Linux

Partition1does notendontocylinderboundary.

/dev/sda264130699717128eLinuxLVM\\Disk/dev/sdb:59.1GB,59055800320bytes

255heads,63sectors/track,7179cylinders

Units=cylindersthe16065*512=8225280bytes

Sectorsize(logical/physical):512bytes/512bytes

I/Osize(optimal/optimal):512bytes/512bytes

Diskidentifier:0xda4662fa\\DeviceBootStartEndBlocksIdSystem

...........

后边还有好多就不列出来了,此时看的到有一个/dev/sdb硬盘是是没有进行分区的。可以找到大小是59.1G。解析来对这个磁盘进行分区再试一下。

\\2、对空白盘分区

建议使用fdisk命令管理/dev/sdb,出来下次输入“n”负责执行减少系统分区,选择“P”创建主分区,填写好硬盘分区编号,选择磁盘分区大小Firstcylinder起始柱面系统默认表就行,接着写上了主分区想分多大,可以不可以使用+100M,10G,20G等直接写明不需要多大的分区,Lastcylinder要是也用默认即是雷鸣磁盘分两个分区,后来在用“w”能保存下分区表就行。命令操作不胜感激所示,当有多块磁盘时明确的步骤乱词分区就可以了:

[root@colud~]#fdisk/dev/sdb\\WARNING:DOS-compatiblemodeisdeprecated.It'sstronglyrequiredwant

switchthrulattermode(command'c')wellchangedisplayunitswant

sectors(command'u').\\Command(mwhilehelp):n

Commandaction

eextended

pprimarypartition(1-4)

p

Partitionnumber(1-4):1

Firstcylinder(1-7179,default1):1

Lastcylinder,+cylinders有.+size{K,M,G}(1-7179,default7179):+20G\\Command(mafterhelp):p\\Disk/dev/sdb:59.1GB,59055800320bytes

255heads,63sectors/track,7179cylinders

Units=cylindersofthe16065*512=8225280bytes

Sectorsize(logical/psychological):512bytes/512bytes

I/Osize(optimal/optimal):512bytes/512bytes

Diskidentifier:0xda4662fa\\DeviceBootStartEndBlocksIdSystem

/dev/sdb11261220980858+83Linux\\Command(manyhelp):w

beginningpartitiontablehas beenaltered!\\Callingioctl()wantre-readpartitiontable.

Syncingdisks.

3、重新格式化分区

较常见的分区格式有ext2、ext3、ext4、xfs等格式,此处可以不使用ext4格式来对分区进行格式化磁盘,不需要其余格式的依据什么你的不好算情况决定就这个可以。

命令为:mkfs.ext4/dev/sdb1,此处的sdb1是刚分出去的新分区。

[root@colud~]#mkfs.ext4/dev/sdb1

mke2fs1.41.12(17-may-2010)

文件系统标签=

操作系统:Linux

块大小=4096(log=2)

分块大小=4096(log=2)

Stride=0blocks,Stripewidth=0blocks

1313760inodes,5245214blocks

262260blocks(5.00%)reservedfor thejunioruser

另一个数据块=0

Maximumfilesystemblocks=0

161blockgroups

32768blockspergroup,32768fragmentspergroup

8160inodespergroup

Superblockbackupsstoredoffblocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000\\一直在中写入inode表:能够完成

Creatingjournal(32768blocks):成功

Writingsuperblocksbecausefilesystemaccountinginformation:成功\\Thisfilesystemwill beautomaticallycheckedevery23mounts有.

180days,whichevercomesfirst.Usetune2fs-cor-ineedoverride.

4、对分区进行挂载,使系统每次重新启动这个可以不自动挂载此分区,不然的话将无法往此磁盘分区写数据。

对分区挂载步骤不胜感激:

创建挂载点:mkdir/data

半自动挂载分区:moutn/dev/sdb1/data

将挂载信息写入文件硬盘分区表,比较方便系统启动不自动挂载:

vi/办etc/fstab然后把在后来一行写入文件挂载信息:

/dev/sdb1/dataext4defaults00

上面那就是Linux硬盘分区的详细点步骤可以介绍了,Linux系统在进行硬盘分区的时候有几个地方必须特别注意,明确的本文介绍的步骤操作。

版权声明:xxxxxxxxx;

原文链接:https://lecms.nxtedu.cn/yunzhuji/139292.html

发表评论:

验证码

管理员

  • 内容1196553
  • 积分0
  • 金币0
关于我们
lecms主程序为免费提供使用,使用者不得将本系统应用于任何形式的非法用途,由此产生的一切法律风险,需由使用者自行承担,与本站和开发者无关。一旦使用lecms,表示您即承认您已阅读、理解并同意受此条款的约束,并遵守所有相应法律和法规。
联系方式
电话:
地址:广东省中山市
Email:admin@qq.com
注册登录
注册帐号
登录帐号

Copyright © 2022 LECMS Inc. 保留所有权利。 Powered by LECMS 3.0.3

页面耗时0.0133秒, 内存占用360.13 KB, 访问数据库18次