怎样设置启动linux分区,Linux系统添加新硬盘分区及设置启动自动挂载教程

在不同的操作系统下添加新硬盘及分区方法也有些不同,Linux与windows系统对比会有些复杂,那么在Linux系统如何添加新硬盘和硬盘分区及硬盘设置驱动自动挂载呢?如果你想要在Linux系统下新添加硬盘的话,本文教程不可错过哦。

Linux系统添加新硬盘分区及设置启动自动挂载方法/步骤

1、检查发现系统上目前并没有挂载新的硬盘,如下图所示:

2、添加硬盘后我们启动电脑并再次检查,我们可以看到最下面多了一行“Disk /dev/sdb doesn't contain a valid partition table”,告诉我们有一块新的硬盘,但是还没有分区;如下图所示:

3、根据以上提示开始对新的硬盘进行分区操作,由于截图比较麻烦所以呢我把命里copy出来了,需要操作的部分我会标记出来

[root@Linux ~]# fdisk /dev/sdb //根据提示,对新硬盘进行分区操作Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable.The number of cylinders for this disk is set to 2610.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)Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): h //帮助信息h: unknown commandCommand 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)

Command (m for help): n //输入 n,新建分区Command action e extended //新建逻辑分区 p primary partition (1-4) //新建主分区p //输入 p,建立主分区Partition number (1-4): 1 //一共可以分4个主分区,输入 1,建立第一个主分区First cylinder (1-2610, default 1): //选择该分区的起始磁盘数,如无特殊需求强烈建议选择默认,也就是默认用1 来分区(直接按回车)Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): //定义该分区的大小,如果按默认(直接回车),就是使用全部可用存储空间;如果要分成一个 1G 的空间,输入 +1024m 即可,1G=1024m算法以此类推Using default value 2610Command (m for help): w //写入分区信息,其实就是保存分区信息The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.

4、完成以上操作后我们可以看到新添加的硬盘已经存在分区了

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值