ubuntu 磁盘分区
1:查看分区情况:df -h
admin@iZwz92c0zpe8t65qe996ckZ:/$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 983M 983M % /dev
tmpfs 201M 24M 177M % /run
/dev/vda1 40G .3G 28G % /
tmpfs 1001M 1001M % /dev/shm
tmpfs 5.0M .0K 5.0M % /run/lock
tmpfs 1001M 1001M % /sys/fs/cgroup
tmpfs 201M 201M % /run/user/
2:查看某一个目录挂载在哪一个分区下面:df -h 目录
admin@iZwz92c0zpe8t65qe996ckZ:/$ df -h /srv/
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G .3G 28G % /
3:给磁盘进行分区:sudo fdisk /dev/vda
admin@iZwz92c0zpe8t65qe996ckZ:/$ sudo fdisk /dev/vda Welcome to fdisk (util-linux 2.27.).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command. Command (m for help): m
使用m查看命令的使用方法
Misc
m print this menu
u change display/entry units
x extra functionality (experts only) Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file Save & Exit
w write table to disk and exit
q quit without saving changes Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table Command (m for help):
命令p打印分区情况:
Command (m for help): p
Disk /dev/vda: GiB, bytes, sectors
Units: sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disklabel type: dos
Disk identifier: 0xd6804155 Device Boot Start End Sectors Size Id Type
/dev/vda1 * 40G Linux
d 删除分区
命令n 添加分区:
Command (m for help): d
Selected partition
Partition has been deleted. Command (m for help): n
Partition type
p primary ( primary, extended, free)
e extended (container for logical partitions)
Select (default p):
添加分区
Select (default p): p
Partition number (-, default ):
First sector (-, default ):
Last sector, +sectors or +size{K,M,G,T,P} (-, default ): Created a new partition of type 'Linux' and of size 19.1 GiB. Command (m for help): p
Disk /dev/vda: GiB, bytes, sectors
Units: sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disklabel type: dos
Disk identifier: 0xd6804155 Device Boot Start End Sectors Size Id Type
/dev/vda1 .1G Linux
再添加一个分区:
Using default response p.
Partition number (-, default ):
First sector (-, default ):
Last sector, +sectors or +size{K,M,G,T,P} (-, default ): Created a new partition of type 'Linux' and of size 20.9 GiB. Command (m for help): p
Disk /dev/vda: GiB, bytes, sectors
Units: sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disklabel type: dos
Disk identifier: 0xd6804155 Device Boot Start End Sectors Size Id Type
/dev/vda1 .1G Linux
/dev/vda2 .9G Linux
使用命令w保存修改
命令q是修改失效,上面修改没用
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe() or kpartx().
执行 partprobe
admin@iZwz92c0zpe8t65qe996ckZ:~$ partprobe
提示 /dev/vda2不存在
执行:sudo mknod /dev/vda2 b 8 4 http://blog.itpub.net/28874898/viewspace-774249/
admin@iZwz92c0zpe8t65qe996ckZ:~$ sudo mknod /dev/vda2 b
sudo: unable to resolve host iZwz92c0zpe8t65qe996ckZ
admin@iZwz92c0zpe8t65qe996ckZ:~$ ll /dev/vda*
brw-rw---- root disk , Oct : /dev/vda
brw-rw---- root disk , Oct : /dev/vda1
brw-r--r-- root root , Oct : /dev/vda2
3:卸载磁盘挂载:
admin@iZwz92c0zpe8t65qe996ckZ:/$ sudo umount /dev/vda
sudo: unable to resolve host iZwz92c0zpe8t65qe996ckZ
umount: /dev/vda: not mounted
4:阿里云安装完系统之后,只有一个分区,想要变成多个分区?
可以先缩小分区的容量,然后用多余的容量去再分区。
ubuntu 磁盘分区的更多相关文章
- ubuntu磁盘分区和挂载
- 安装Linux系统的磁盘分区
●CentOS磁盘分区 分区顺序: "/"分区(逻辑) -> "/boot"分区(主分区) -> "swap"分区(逻辑) -& ...
- 双系统Ubuntu无法访问windows磁盘分区解决方法
为了更好的体验各种操作系统,在电脑中安装双系统是很好的选择,但在使用中难免会遇到这样或那样的问题. 最近总是遇到Ubuntu系统下无法访问windows磁盘分区问题,看了系统日志发现是挂载磁盘出问题了 ...
- 【Linux探索之旅】第一部分第四课:磁盘分区,并完成Ubuntu安装
内容简介 1.第一部分第四课:磁盘分区,并完成Ubuntu安装 2.第一部分第五课预告:Unity桌面,人生若只如初见 磁盘分区 上一课我们正式开始安装Ubuntu了,但是到了分区的那一步,小编却戛然 ...
- Ubuntu访问window下的磁盘分区出现“Error mounting /dev/sda5 at/media”错误的解决方法
我装ubuntu之前,电脑上安装了windows 10,为了装ubuntu,在window 10下的磁盘工具分配了30G的磁盘空间.安装完Ubuntu之后,访问window 10的磁盘分区出现“Err ...
- ubuntu系统分区方案
一.各文件及文件夹的定义 /bin:bin是binary(二进制)的缩写.存放必要的命令 存放增加的用户程序. /bin分区,存放标准系统实用程序./boot:这里存放的是启动LINUX时使用的一些核 ...
- Linux 磁盘与磁盘分区
Linux 系统中所有的硬件设备都是通过文件的方式来表现和使用的,我们将这些文件称为设备文件,硬盘对应的设备文件一般被称为块设备文件.本文介绍磁盘设备在 Linux 系统中的表示方法以及如何创建磁盘分 ...
- 磁盘分区(20G升50G)
不多说,直接上干货! 本博文的主要内容有 .磁盘分区的概述 .常用的磁盘管理工具 ./下分5G,给/home扩容 .系统自带的fdisk和parted这两款工具 .磁盘空间管理 前言 ...
- Linux磁盘分区UUID的获取及其UUID的作用
注:UUID-Universally Unique IDentifiers全局唯一标识符 一.Linux磁盘分区UUID的获取方法 1.[san@localhost ~]$ ls -l /dev/di ...
随机推荐
- jQuery属性操作(二)
挂载到$上的几个属性操作方法分析,发现属性操作用到了sizzle封装的方法 attr: function( elem, name, value ) { var hooks, ret, ...
- Linux SVN 服务器
一. SVN 简介 Subversion(SVN) 是一个开源的版本控制系統, 也就是说 Subversion 管理着随时间改变的数据. 这些数据放置在一个中央资料档案库 (repository) 中 ...
- docker报错“net/http: TLS handshake timeout”的解决方法
为了永久性保留更改,您可以修改 /etc/docker/daemon.json 文件并添加上 registry-mirrors 键值. { "registry-mirrors": ...
- centos 6.6编译安装nginx
nginx 安装 安装前必要软件准备 1)安装pcre.gzip 等为了支持rewrite功能,我们需要安装pcre # yum install -y pcre* zlib zlib-devel op ...
- 神奇的thrust::device_vector与nvcc编译选项
在C++的GPU库thrust中,有两种vector thrust::device_vector<int> D; //GPU使用的内存中的向量 thrust::host_vector< ...
- Linux命令记录----chkconfig命令
chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息.谨记chkconfig不是立即自动禁止或激活一个服务,它只是简单的改变了符号连接. 使用语法:chkconfig [--ad ...
- CentOS7.5搭建Solr7.4.0集群服务
一.Solr集群概念 solr单机版搭建参考: https://www.cnblogs.com/frankdeng/p/9615253.html 1.概念 SolrCloud(solr 云)是Solr ...
- Python 重定向获取真实url
通常的返回url: http_headers = { 'Accept': '*/*','Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (W ...
- IE new Date NaN 问题
var ctime = "2015/1/7 10:35"; ctime = ctime.replace(/-/g,"/"); //为了兼容IE var date ...
- poj3662 Telephone Lines【最短路】【二分】
http://poj.org/problem?id=3662 Telephone Lines Time Limit: 1000MS Memory Limit: 65536K Total Submi ...