linux加载硬盘过程
查看系统可用磁盘大小:
[root@i-mbyar7df ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 20G 7.3G 12G 39% /
tmpfs 32G 72K 32G 1% /dev/shm
查看服务器可用磁盘:
[root@i-mbyar7df ~]# fdisk -l
Disk /dev/sdb: 8589 MB, 8589934592 bytes
64 heads, 32 sectors/track, 8192 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00026e4e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20970496 83 Linux
Disk /dev/sdc: 53.7 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
格式化磁盘/dev/sdc:
[root@i-mbyar7df ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xfb75b574.
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): m --查看帮助
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n --添加一个新的分区
Command action
e extended
p primary partition (1-4)
p -----主分区
Partition number (1-4): 1 ----分区号为1
First cylinder (1-51200, default 1): ---默认从1开始
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-51200, default 51200): --默认51200结束
Using default value 51200
Command (m for help): w ---对以上更改报错到磁盘
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
格式化成相应文件系统类型:
查看系统磁盘分区:
[root@i-mbyar7df ~]# fdisk -l
Disk /dev/sdb: 8589 MB, 8589934592 bytes
64 heads, 32 sectors/track, 8192 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00026e4e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20970496 83 Linux
Disk /dev/sdc: 53.7 GB, 53687091200 bytes
64 heads, 32 sectors/track, 51200 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfb75b574
Device Boot Start End Blocks Id System
/dev/sdc1 1 51200 52428784 83 Linux
格式化具体挂载分区:
[root@i-mbyar7df ~]# mkfs.ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3276800 inodes, 13107196 blocks
655359 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: --回车默认即可
done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
创建挂载磁盘目录:
[root@i-mbyar7df ~]# mkdir /data
挂载/dev/sdc1到目录/data:
[root@i-mbyar7df ~]# mount /dev/sdc1 /data
[root@i-mbyar7df ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 20G 7.3G 12G 39% /
tmpfs 32G 72K 32G 1% /dev/shm
/dev/sdc1 50G 180M 47G 1% /data
设置linux系统开机自动挂载磁盘:
1)查看磁盘UUID
[root@i-mbyar7df ~]# blkid /dev/sdc1
/dev/sdc1: UUID="0c43e879-0e8b-4633-aa7b-d3c5a0e10614" TYPE="ext4"
2)编写/etc/fstab文件:添加最后一行信息,保存退出即可。
[root@i-mbyar7df ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Jun 21 09:11:21 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=261e0e16-2332-4716-9af4-0d0449a53c92 / ext4 defaults 1 1
LABEL=YUNIFYSWAP swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=0c43e879-0e8b-4633-aa7b-d3c5a0e10614 /data ext4 defaults 0 2
linux加载硬盘过程的更多相关文章
- Linux:加载硬盘
在腾讯云购买了一个云服务器,送了20G的系统盘,购买了一个50G的数据盘. 第一次进入系统后,通过镜像中自带的脚本,挂载数据盘. 后来重装了系统,进入系统后查看硬盘信息.
- linux内核被加载的过程
二,linux内核被加载的过程 一,linux安装时遇到的概念解析 内核必须模块vmlinz(5M左右)不认识硬盘,原本是需要写跟loader中一样的内容,来加载非必要模块. 内核非必要的功能被编译为 ...
- Linux服务器配置之加载硬盘
Linux服务器配置之加载硬盘 1.修改密码 passwd 2.测试密码是否成功 3.查看硬盘信息 fdisk –l 4.格式化分区 fdisk /dev/vdb 5.查看分区 6.快速格式化/dev ...
- 动态加载JS过程中如何判断JS加载完成
在正常的加载过程中,js文件的加载是同步的,也就是说在js加载的过程中,浏览器会阻塞接下来的内容的解析.这时候,动态加载便显得尤为重要了,由于它是异步加载,因此,它可以在后台自动下载,并不会妨碍其它内 ...
- linux加载指定目录的so文件
linux加载指定目录的so文件 http://blog.csdn.net/win_lin/article/details/8286125 download urlhttp://download.ch ...
- 如何让linux加载当前目录的动态库
debian从7.0开始支持multiarch,64位库的路径改到/usr/lib/x86_64-linux-gnu了,mint.ubuntu这些衍生版有没有跟着改我就不清楚了. deepin lin ...
- log4j的学习和log4j在程序中使用的加载作用过程
昨天进行代码评审的时候,大家都纠结在了日志信息应该如何输出上,其实我想大家应该一直都在使用log4j来对日志信息进行输出,但是未想应该有很大一部分人对log4j是不了解的,我遇到这个问题的时候也到网上 ...
- FreeSWITCH 加载模块过程解读
今天来学习FreeSWITCH 加载模块过程. 哪些模块需要编译,是由源码下的 modules.conf 文件决定的. 哪些模块在程序启动时自动加载,是由 freeswitch/conf/autolo ...
- Linux加载DTS设备节点的过程(以高通8974平台为例)
DTS是Device Tree Source的缩写,用来描述设备的硬件细节.在过去的ARM Linux中,arch/arm/plat-xxx和arch/arm/mach-xxx中充斥着大量的垃圾代码, ...
随机推荐
- Swing开发图形界面有如下优势
Swing开发图形界面有如下优势 : Swing组件不再依赖于本地平台的GUI,无须采用各种平台的GUI交集,因此Swing提供了大量图形界面组件,远远超出了AWT所提供的图形界面组件集. Swing ...
- HEVC/H.265 的未来必须是使用并行处理(OpenCL?) OpenCV和OpenCL区别
1 扩展库简介 OpenCV(Open Source Computer Vision Library)是一个致力于实时处理计算机视觉问题的开源库.它最初由Intel公司开发,以GPL许可协议发布,后来 ...
- linux -- ubuntu 脚本开机自启动
有一个脚本想在ubuntu 虚拟机开机时,自动运行. 创建脚本文件 在“/opt/lampp/”下新建一个脚本文件:lampp_start.sh #!/bin/bash /opt/lampp/lamp ...
- 多个进程对同一个监听套接字调用函数gen_tcp:accept/1
源于<<erlang程序设计>>的第14章的14.1.4大约第197页. 未发现多个进程对同一个监听套接字调用函数gen_tcp:accept/1比单进程的效率更高或者更快.
- CentOS系统资源常用命令
系统: # uname -a # 查看内核/操作系统/CPU信息 # cat /etc/issue # cat /etc/redhat-release # 查看操作系统版本 # cat /proc ...
- linux 访问远程务器代码
比如用SSH 访问远程 登陆名为hadoop 的IP为192.168.1.35的主机,则用ssh hadoop@192.168.1.35,然后依据提示输入密码即可.
- Unity对象查找
1. GameObject.Find 全局摄像机 全局画布 全局灯光 无法查找隐藏对象 ,效率低下,要用完全的路径来提升查找效率 2. transform.Find UI中全部使用此方法 可以查找 ...
- layui时间,table,大图查看,弹出框,获取音频长度,文件上传
1.引入: <link href="../../Scripts/layui-v2.3.0/css/layui.css" rel="stylesheet" ...
- mybatis由浅入深day02_7查询缓存_7.2一级缓存_一级缓存应用
7 查询缓存 7.1 什么是查询缓存 mybatis提供查询缓存,用于减轻数据压力,提高数据库性能. mybaits提供一级缓存,和二级缓存. 一级缓存是SqlSession级别的缓存.在操作数据库时 ...
- apache+php生产环境错误记录
报错1: [18-Jul-2016 14:36:31 Asia/Shanghai] PHP Warning: DOMDocument::load(): I/O warning : failed to ...