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 ...
随机推荐
- 《转》Python学习(17)-python函数基础部分
http://www.cnblogs.com/BeginMan/p/3171977.html 一.什么是函数.方法.过程 推荐阅读:http://www.cnblogs.com/snandy/arch ...
- Stratix内嵌存储器测试报告
Stratix和Stratix GX系列器件内嵌TriMatrix存储块包括512-bit M512块.4-Kbit M4K块及512-Kbit M-RAM块.TriMatrix存储结构可对 ...
- C语言变量的存储布局
分析以下代码中变量存储空间如何分配: //MemSeg.c: 代码无意义,仅供分析用 #include <stdio.h> #include <stdlib.h> //mall ...
- Underscore.js(JavaScript对象操作方法)
Underscore封装了常用的JavaScript对象操作方法,用于提高开发效率.(Underscore还可以被使用在Node.js运行环境.) 在学习Underscore之前,你应该先保存它的AP ...
- Ubuntu 14.04 DNS 配置
最近得到一个比较好用的DNS,每次重启后都修改DNS配置文件 /etc/resolv.conf 重启就会失效 从网上得知 /etc/resolv.conf中的DNS配置是从/etc/resolvcon ...
- Tomorrow Is A New Day
Sometimes we do not feel like we want to feel Sometimes we do not achieve what we want to achiev ...
- Python pyQt4/PyQt5 学习笔记3(绝对对位,盒布局,网格布局)
本节研究布局管理的内容. (一)绝对对位 import sys from PyQt4 import QtGui class Example(QtGui.QWidget): def __init__( ...
- bs-loading
根据bootstrap的modal来显示loading动效. 核心内容: 1.图片转base64方法: // 图片压缩-start function run(input_file,get_data){ ...
- [原]openstack-kilo--issue(三) openstack-nova-issue-systemctl start openstack-nova-compute.service
本博客已经添加"打赏"功能,"打赏"位置位于右边栏红色框中,感谢您赞助的咖啡. execute systemctl start openstack-nova-c ...
- [原]openstack-kilo--issue(二) openstack auth error
/** 系统环境:redhat7.2 repo:163 openstack version : kilo author: lihaibo 本博客已经添加"打赏"功能,"打 ...