Linux磁盘分区、格式化和挂载
一、查看磁盘使用
[root@iZ88rvassw1Z ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 2.3G 36G 7% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
二、查看磁盘分区
[root@iZ88rvassw1Z ~]# fdisk -l Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078f9c Device Boot Start End Blocks Id System
/dev/vda1 * 1 5222 41940992 83 Linux Disk /dev/vdb: 1099.5 GB, 1099511627776 bytes
16 heads, 63 sectors/track, 2130440 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
目前系统存在了两块磁盘,分别为“/dev/vda”和“/dev/vdb”;
“/dev/vda”已经存在了一个分区“/dev/vda1”;
“/dev/vda1”没有分区。
三、磁盘分区命令
四、执行分区操作
[root@iZ88rvassw1Z ~]# fdisk /dev/vdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x3d7d21d6.
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 to
switch off the mode (command 'c') and change display units to
sectors (command 'u'). Command (m for help): p Disk /dev/vdb: 1099.5 GB, 1099511627776 bytes
16 heads, 63 sectors/track, 2130440 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3d7d21d6 Device Boot Start End Blocks Id System Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2130440, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2130440, default 2130440):
Using default value 2130440 Command (m for help): p Disk /dev/vdb: 1099.5 GB, 1099511627776 bytes
16 heads, 63 sectors/track, 2130440 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3d7d21d6 Device Boot Start End Blocks Id System
/dev/vdb1 1 2130440 1073741728+ 83 Linux Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
No free sectors available Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.
[root@iZ88rvassw1Z ~]#
再次查看分区:
五、查看原有分区格式
为ext4格式。
六、格式化分区
七、挂载分区
八、开机自动挂载
修改/etc/fstab,添加记录即可。
Linux磁盘分区、格式化和挂载的更多相关文章
- linux增加硬盘 磁盘分区格式化及挂载
nux磁盘分区格式化及挂载 意义: 给linux 系统服务器扩容, 加一块硬盘 实验环境: virtualBox虚拟软件 + centos6.5 第一步: 添加硬件 硬盘 (我这里用virtualB ...
- Linux磁盘分区/格式化/挂载(树莓派3挂载硬盘)
[前言] 本文将要讲解的功能为Linux环境下对磁盘进行操作.包括分区.格式化.挂载外接移动存储设备等. 该文的写作背景为本人的树莓派需要外接一个固态硬盘作为存储设备,因此,便开始了一系列的折腾. [ ...
- Linux磁盘分区/格式化/挂载目录
分区及挂载目录 以CentOS7.2为例,一般我们服务端应用部署前需要确认部署机的磁盘空间及挂载目录.操作如下: 如上图,如果操作系统是新装的,未挂盘的话需要先挂载盘.操作如下: fdisk -l # ...
- linux硬盘分区格式化及挂载
1.硬盘的接口类型 硬盘的接口一般分为两种,一种是IDE并行接口,一种是SATA串行接口, 在linux上面IDE接口的硬盘被识别为/dev/hd[a-z]这样的设备,其中hdc表示光驱设备,这是因为 ...
- linux磁盘分区格式化-fdisk命令工具
本文主要讲述使用fdisk工具对磁盘进行分区和格式化的方法 首先要明确分区是针对磁盘进行的操做,磁盘分区会创建分区表,类似vda,sda的是磁盘,vda1,sda1的是分区 1.查看磁盘分区状态 1. ...
- Linux磁盘分区格式化和扩容
Note:根据各系统上磁盘的类型不同,磁盘命名规则也会不同:例如/dev/xvd,/dev/sd,/dev/vd,/dev/hd 目录 磁盘格式化 MBR格式 GPT分区 磁盘扩容 MBR格式扩容 G ...
- 【linux磁盘分区--格式化】fdisk,parted,mkfs.ext3
磁盘分区完成后,一般就需要对分区进行格式化 磁盘分区命令主要有两个: fdisk :最大支持不超过2T分区: parted :支持GPT,适用于大容量分区: 分区指令的选择: 在RHEL系统上,用fd ...
- centos 磁盘分区格式化与挂载
1 查看系统里硬盘信息fdisk -l 2 磁盘分区fdisk /dev/sdc输入m显示帮助a:命令指定启动分区:d:命令删除一个存在的分区:l:命令显示分区ID号的列表:m:查看fdisk命令帮助 ...
- Linux磁盘分区与格式化
磁盘分区格式说明 linux分区不同于windows linux下分区标示: 例如:hda1 hd这两个字母表示分区所在的设备类型,hd标示IDE类型硬盘,sd表示SCSI类型硬盘 第三字母a标示硬盘 ...
- Linux磁盘分区和挂载
Linux磁盘分区和挂载 分区 分区的方式: mbr分区 最多支持4个主分区 系统只能安装到主分区上 扩展分区要占用一个主分区 MBR最大支持2TB,但拥有最好的兼容性 gtp分区 支持无线多个主分区 ...
随机推荐
- c++之虚基类初始化
C++虚基类构造函数下面文章详细介绍C++虚基,所谓C++虚基类:是由最派生类的构造函数通过调用虚基类的构造函数进行初始化的,但前提是要深入理解到底什么是C++虚基类,及他是怎么运行的. 前面讲过,为 ...
- 从JVM的角度看JAVA代码--代码优化
从JVM的角度看JAVA代码–代码优化 从JVM的角度看JAVA代码代码优化 片段一反复计算 片段二反复比較 在JVM载入优化为class文件,运行class文件时,会有JIT(Just-In-Tim ...
- libsvm源码凝视+算法描写叙述:svm_train
(I will try my best to make this note clearer. We mainly focus on solve_c_svc in this note) We mainl ...
- Qt Quick 图像处理实例之美图秀秀(附源代码下载)
在<Qt Quick 之 QML 与 C++ 混合编程具体解释>一文中我们解说了 QML 与 C++ 混合编程的方方面面的内容,这次我们通过一个图像处理应用.再来看一下 QML 与 C++ ...
- vue-cli中process.env配置以及打包本地运行或者线上运行配置
我们知道打包默认npm run build,可是打包后点击dist文件中index.html一片空白.问题在于路径问题.我们在工程文件的最外层增加文件.env.production这个文件就是这么奇怪 ...
- ubuntu下打开eclipse·发现没有顶尖菜单项
在安装eclipse时,打开集成开发环境后没有菜单项. 网上些人说要写个shell脚步,感觉有点麻烦,其实就是少了一个环境变量 BUNTU_MENUPROXY. 在/etc/profile 里面新建这 ...
- jquery获取兄弟元素
按照w3c school的指引,jquery中,要获得一个元素的兄弟,可以用 prev().next()两种方法.顾名思义,prev()获得前一个,next()获得后面一个. 问题是,如果存在前后兄弟 ...
- java8--网络编程(java疯狂讲义3复习笔记)
重点复习一下网络通信和代理 java的网络通信很简单,服务器端通过ServerSocket建立监听,客户端通过Socket连接到指定服务器后,通信双方就可以通过IO流进行通信. 需要重点看的工具类:I ...
- GET 与 POST 的理解
1 HTTP请求 超文本传输协议(HTTP)的设计目的是保证客户机与服务器之间的通信. HTTP 的工作方式是客户机与服务器之间的请求-应答协议. 比如,客户端(浏览器) ...
- YTU 2437: C++ 习题 比较大小-类模板
2437: C++ 习题 比较大小-类模板 时间限制: 1 Sec 内存限制: 128 MB 提交: 1144 解决: 805 题目描述 声明一个类模板,利用它分别实现两个整数.浮点数和字符的比较 ...