欢迎您访问系统网
您现在的位置是:首页» windows系统» linux如何查看硬盘数量,linux查看硬盘信息

linux如何查看硬盘数量,linux查看硬盘信息

2024-07-17 12:34:12
本内容由系统网小编为大家分享,Windows系统安装教程、办公系统、软件怎么使用、软件使用教程、办公软件攻略等信息。linux查看有几块硬盘一、整体流程 1、把新硬盘连接起来2、在CMOS里配置新硬盘3、查看硬盘代号4、用 fdisk 对硬

本内容由系统网小编为大家分享,Windows系统安装教程、办公系统、软件怎么使用、软件使用教程、办公软件攻略等信息。

linux查看有几块硬盘

一、整体流程 1、把新硬盘连接起来2、在CMOS里配置新硬盘3、查看硬盘代号4、用 fdisk 对硬盘进行分区5、格式化分区6、创建挂载点7、设置/dev/fstab 以便开机时自动挂载分区8、设置新硬盘分区的读写权限 二、具体操作步骤 1、把新硬盘连接起来,属于硬件操作,注意主板和硬盘的接口插正确就可以了。 2、在CMOS里配置新硬盘启动计算机,并进入CMOS,让机器找到新硬盘。IDE Channel 0Master: none (没有盘)IDE Channel 0Slave: none (没有盘)IDE Channel 1Master: 是DVD-ROMIDE Channel 1Slave: none (没有盘)IDE Channel 2Master: HDS728080PLA380 (原来的80GBSATA I 硬盘)IDE Channel 3Master: none (没有盘)在none 的Channels一个一个地让计算机自动寻找硬盘。最后发现了:IDE Channel 3Master: ST31000528AS (新的1000GB SATA II型硬盘) 3、 查看硬盘代号$ df发现:写道/dev/sda1 /C_disk 15GB 7 (reserved for Windows XP, my PC is adual- system)/dev/sda2 / 15GB 83 (Linux)/dev/sda3 LinuxLVM 8e (Linux)/dev/sda4 extended/dev/sda5 82 (Linux Swap, 512MB, twice of the momoey)/dev/sda6 /data 83 (Linux, mounted on /data, 45.5GB)注意: SATA (通常称串口盘) 在Linux下被视为SCSI 盘(一种早期用在Sun工作站上和服务器 的高速硬盘,那时很贵!)。可以判定: 新的硬盘应该就是/dev/sdb 了。进入超级用户:写道$ su -lpassword: yoursecrets[root@Lenovo~]#[root@Lenovo~]# fdisk -l出现类似下面的信息(以下提示信息仅供参考,有的并非本人实际操作时的屏幕显示,但意思是一样 的):写道Disk/dev/sda: 10.7 GB, 10737418240 bytes255heads, 63 sectors/track, 1305 cylindersUnits= cylinders of 16065 * 512 = 8225280 bytesDiskidentifier: 0x0007d856DeviceBoot Start End Blocks Id System/dev/sda1 * 1 25 200781 83 Linux/dev/sda2 26 1305 10281600 8e LinuxLVMDisk /dev/sdb: 2147 MB, 2147483648 bytes <=新硬盘255heads, 63 sectors/track, 261 cylindersUnits= cylinders of 16065 * 512 = 8225280 bytesDiskidentifier: 0x00000000Disk /dev/sdb doesn't contain a validpartition table 4、 用 fdisk 对硬盘进行分区写道[root@Lenovo~]#fdisk /dev/sdbDevicecontains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuildinga new DOS disklabel with disk identifier 0x623223a1.Changeswill remain in memory only, until you decide to write them.Afterthat, of course, the previous content won't be recoverable.Warning: invalid flag 0x0000 ofpartition table 4 will be corrected by w(rite)Command (m for help): p <=显示信息Disk /dev/sdb: 1002.2 GB, 10*** bytes255heads, 63 sectors/track, 121601 cylindersUnits= cylinders of 16065 * 512 = 8225280 bytesDiskidentifier: 0x623223a1DeviceBoot Start End Blocks Id SystemCommand (m for help): n <=新建分区Commandactione extendedp primarypartition (1-4)p <=新建主分区Partitionnumber (1-4): 1 <=分区号为1,即/dev/sdb1Firstcylinder (1-261, default 1): 回车取默认值Usingdefault value 1Lastcylinder or +size or +sizeM or +sizeK (1-261, default 261): 回车取默认值Usingdefault value 261Command (m for help): p <=显示分区信息Disk /dev/sdb: 2147 MB, 2147483648 bytes255heads, 63 sectors/track, 261 cylindersUnits= cylinders of 16065 * 512 = 8225280 bytesDiskidentifier: 0x623223a1DeviceBoot Start End Blocks Id System/dev/sdb1 1 261 2096451 83 LinuxCommand (m for help): w <=保存退出Thepartition table has been altered!Callingioctl() to re-read partition table.Syncingdisks. 5、格式化分区写道# mkfs.ext4 -L disk2 /dev/sdb1 --格式化的同时给新硬盘加标签为 disk2或者 mkfs.ext4 /dev/sdb1 --只格式化但不加标签单独加标签的命令是: # e2label /dev/sdb1 /disk2 6、创建挂载点写道[root@Lenovo~]# mkdir /disk2 7、设置/dev/fstab 以便开机时自动挂载分区:写道[root@Lenovo~]# vi /etc/fstab添加一行:/dev/sdb1 /disk2 ext4 auto 1 2若一次性手动挂载分区 ,使用命令: #mount /dev/sdb1 /disk2/ 8、设置新硬盘或分区的读写权限:# chmod a+w /disk2 这样所有计算机的用户都可以读写该分区,即/disk2盘了sudo fdisk -l

XTw.com.Cn系统网专业应用软件下载教程,免费windows10系统,win11,办公软件,OA办公系统,OA软件,办公自动化软件,开源系统,移动办公软件等信息,解决一体化的办公方案。

免责声明:本文中引用的各种信息及资料(包括但不限于文字、数据、图表及超链接等)均来源于该信息及资料的相关主体(包括但不限于公司、媒体、协会等机构)的官方网站或公开发表的信息。内容仅供参考使用,不准确地方联系删除处理!

联系邮箱:773537036@qq.com