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 ...
随机推荐
- WP8.1学习系列(第十二章)——全景控件Panorama开发指南
2014/6/18 适用于:Windows Phone 8 和 Windows Phone Silverlight 8.1 | Windows Phone OS 7.1 全景体验是本机 Windows ...
- nginx命令行参数和信号
nginx命令行参数 [user@host dir]$ /usr/local/nginx/sbin/nginx -hnginx version: nginx/1.8.0Usage: nginx [-? ...
- HDU 4004 The Frog's Games(二分答案)
The Frog's Games Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) ...
- EUI ViewStack实现选项卡组件 (封装了一个UI类)
封装一个选项卡的UI,用来应付游戏中各种需要选项卡的界面. 例如背包,背包界面的选项卡可以切换装备.物品.符文.宝箱. 下图方法的实现参考:EUI ViewStack实现选项卡组件 假如在主页Home ...
- 【咸鱼教程】本地图片上传。动态GIF表情图生成
本案例参考:http://emoji.decathlon.trustingme.cn/但是实现方式不一样. 教程目录一 head first二 打开本地图片功能三 拖拽和缩放手势,调整图片四 gifj ...
- 应用Strong Name保存.NET应用程序集
关于Strong Name的主题,网上已经有很多这方面的介绍,你可能最熟悉的印象就是这样 大部分的情况,这样就可以了.如果代码是机密的,还可能用到Delay sign only,这就复杂一些,请查找相 ...
- Asp.Net MVC大型项目实践整合 NHibernate与Json序列化
通过NHibernate我们多表查询是实现了 但由于查询出来的集合中的对象“不是平的”,如何在送到UI绑定成了问题.ExtJs UI组件的数据绑定支持多种格式,如简单数组,Json,Xml.在本项目中 ...
- [通信] C#多线程Socket-文件传输
FileSendClient : Form1.cs using System; using System.IO; using System.Net; using System.Net.Sockets; ...
- python nose测试框架全面介绍八---接口测试中非法参数的断言
在测接口时,会有这样的场景,输入非法的参数,校验返回的错误码及错误内容 通常做法为发请求,将错误的返回结果拿出,再进行对比匹配:但存在一个问题,需要再写错误返回分析函数,不能与之前正常发请求的函数共用 ...
- 应用程序添加角标和tabBar添加角标,以及后台运行时显示
1.设置角标的代码: // 从后台取出来的数据可能是int型的不能直接给badgeValue(string类型的),需要通过description转化 NSString *count = [re ...