1. [root@cloud /]# passwd
  2. 更改用户 root 的密码
  3. 新的 密码:
  4. 重新输入新的 密码:
  5. passwd 所有的身份验证令牌已经成功更新。
  6. [root@cloud /]# fdisk
  7.  
  8. Usage:
  9. fdisk [options] <disk> change partition table
  10. fdisk [options] -l <disk> list partition table(s)
  11. fdisk -s <partition> give partition size(s) in blocks
  12.  
  13. Options:
  14. -b <size> sector size (, , or )
  15. -c switch off DOS-compatible mode
  16. -h print help
  17. -u <size> give sizes in sectors instead of cylinders
  18. -v print version
  19. -C <number> specify the number of cylinders
  20. -H <number> specify the number of heads
  21. -S <number> specify the number of sectors per track
  22.  
  23. [root@cloud /]# fdisk -l
  24.  
  25. Disk /dev/sda: 10.7 GB, bytes
  26. heads, sectors/track, cylinders
  27. Units = cylinders of * = bytes
  28. Sector size (logical/physical): bytes / bytes
  29. I/O size (minimum/optimal): bytes / bytes
  30. Disk identifier: 0x00073ffb
  31.  
  32. Device Boot Start End Blocks Id System
  33. /dev/sda1 * Linux
  34. Partition does not end on cylinder boundary.
  35. /dev/sda2 8e Linux LVM
  36.  
  37. Disk /dev/sdb: 53.7 GB, bytes
  38. heads, sectors/track, cylinders
  39. Units = cylinders of * = bytes
  40. Sector size (logical/physical): bytes / bytes
  41. I/O size (minimum/optimal): bytes / bytes
  42. Disk identifier: 0x00000000
  43.  
  44. Disk /dev/mapper/vg_cloud-lv_root: MB, bytes
  45. heads, sectors/track, cylinders
  46. Units = cylinders of * = bytes
  47. Sector size (logical/physical): bytes / bytes
  48. I/O size (minimum/optimal): bytes / bytes
  49. Disk identifier: 0x00000000
  50.  
  51. Disk /dev/mapper/vg_cloud-lv_swap: MB, bytes
  52. heads, sectors/track, cylinders
  53. Units = cylinders of * = bytes
  54. Sector size (logical/physical): bytes / bytes
  55. I/O size (minimum/optimal): bytes / bytes
  56. Disk identifier: 0x00000000
  57.  
  58. [root@cloud /]# df -h
  59. 文件系统 容量 已用 可用 已用%% 挂载点
  60. /dev/mapper/vg_cloud-lv_root
  61. .5G .5G .7G % /
  62. tmpfs 503M 72K 503M % /dev/shm
  63. /dev/sda1 485M 32M 428M % /boot
  64. [root@cloud /]# fdisk /dev/sdb
  65. Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
  66. Building a new DOS disklabel with disk identifier 0x6f476ca3.
  67. Changes will remain in memory only, until you decide to write them.
  68. After that, of course, the previous content won't be recoverable.
  69.  
  70. Warning: invalid flag 0x0000 of partition table will be corrected by w(rite)
  71.  
  72. WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
  73. switch off the mode (command 'c') and change display units to
  74. sectors (command 'u').
  75.  
  76. Command (m for help): m
  77. Command action
  78. a toggle a bootable flag
  79. b edit bsd disklabel
  80. c toggle the dos compatibility flag
  81. d delete a partition
  82. l list known partition types
  83. m print this menu
  84. n add a new partition
  85. o create a new empty DOS partition table
  86. p print the partition table
  87. q quit without saving changes
  88. s create a new empty Sun disklabel
  89. t change a partition's system id
  90. u change display/entry units
  91. v verify the partition table
  92. w write table to disk and exit
  93. x extra functionality (experts only)
  94.  
  95. Command (m for help): n
  96. Command action
  97. e extended
  98. p primary partition (-)
  99.  
  100. Invalid partition number for type `'
  101. Command action
  102. e extended
  103. p primary partition (-)
  104. p
  105. Partition number (-):
  106. First cylinder (-, default ):
  107. Using default value
  108. Last cylinder, +cylinders or +size{K,M,G} (-, default ):
  109. Using default value
  110.  
  111. Command (m for help): w
  112. The partition table has been altered!
  113.  
  114. Calling ioctl() to re-read partition table.
  115. Syncing disks.
  116. [root@cloud /]# fdisk -l
  117.  
  118. Disk /dev/sda: 10.7 GB, bytes
  119. heads, sectors/track, cylinders
  120. Units = cylinders of * = bytes
  121. Sector size (logical/physical): bytes / bytes
  122. I/O size (minimum/optimal): bytes / bytes
  123. Disk identifier: 0x00073ffb
  124.  
  125. Device Boot Start End Blocks Id System
  126. /dev/sda1 * Linux
  127. Partition does not end on cylinder boundary.
  128. /dev/sda2 8e Linux LVM
  129.  
  130. Disk /dev/sdb: 53.7 GB, bytes
  131. heads, sectors/track, cylinders
  132. Units = cylinders of * = bytes
  133. Sector size (logical/physical): bytes / bytes
  134. I/O size (minimum/optimal): bytes / bytes
  135. Disk identifier: 0x6f476ca3
  136.  
  137. Device Boot Start End Blocks Id System
  138. /dev/sdb1 Linux
  139.  
  140. Disk /dev/mapper/vg_cloud-lv_root: MB, bytes
  141. heads, sectors/track, cylinders
  142. Units = cylinders of * = bytes
  143. Sector size (logical/physical): bytes / bytes
  144. I/O size (minimum/optimal): bytes / bytes
  145. Disk identifier: 0x00000000
  146.  
  147. Disk /dev/mapper/vg_cloud-lv_swap: MB, bytes
  148. heads, sectors/track, cylinders
  149. Units = cylinders of * = bytes
  150. Sector size (logical/physical): bytes / bytes
  151. I/O size (minimum/optimal): bytes / bytes
  152. Disk identifier: 0x00000000
  153.  
  154. [root@cloud /]# mkfs.ext3 /dev/sdb1
  155. mke2fs 1.41. (-May-)
  156. 文件系统标签=
  157. 操作系统:Linux
  158. 块大小= (log=)
  159. 分块大小= (log=)
  160. Stride= blocks, Stripe width= blocks
  161. inodes, blocks
  162. blocks (5.00%) reserved for the super user
  163. 第一个数据块=
  164. Maximum filesystem blocks=
  165. block groups
  166. blocks per group, fragments per group
  167. inodes per group
  168. Superblock backups stored on blocks:
  169. , , , , , , , , ,
  170. , ,
  171.  
  172. 正在写入inode表: 完成
  173. Creating journal ( blocks): 完成
  174. Writing superblocks and filesystem accounting information: 完成
  175.  
  176. This filesystem will be automatically checked every mounts or
  177. days, whichever comes first. Use tune2fs -c or -i to override.
  178. [root@cloud /]# ls
  179. bin dev home lost+found media2 mnt opt root selinux sys usr
  180. boot etc lib media misc net proc sbin srv tmp var
  181. [root@cloud /]# cd home
  182. [root@cloud home]# ls
  183. [root@cloud home]# ls -a
  184. . ..
  185. [root@cloud home]# cd ..
  186. [root@cloud /]# mount /dev/sdb1 /home/
  187. [root@cloud /]# df -h
  188. 文件系统 容量 已用 可用 已用%% 挂载点
  189. /dev/mapper/vg_cloud-lv_root
  190. .5G .4G .7G % /
  191. tmpfs 503M 72K 503M % /dev/shm
  192. /dev/sda1 485M 32M 428M % /boot
  193. /dev/sdb1 50G 180M 47G % /home
  194. [root@cloud /]# echo "/dev/sdb1 /home ext3 defaults 1 1" >> /etc/fstab
  195. [root@cloud /]# reboot
  196.  
  197. Broadcast message from root@cloud
  198. (/dev/pts/) at : ...
  199.  
  200. The system is going down for reboot NOW!

首先修改密码:passwd

查看磁盘信息:df -h

磁盘分区:fdisk

格式化硬盘:mkfs

挂载:mount

使挂载重启后生效:echo "/dev/sdb1 /home ext3 defaults 1 1" >> /etc/fstab

centos 格式化硬盘并挂载,添加重启后生效的更多相关文章

  1. centos 7中磁盘挂载重启后挂载失效

     在centos 7磁盘挂载成功后,关机重启,挂载磁盘失效,需要重新挂载,不用重新挂载的开机挂载方法如下: 1.先检验要挂载的磁盘是否已被挂载,有的话先卸除 2.修改 /etc/fstab 文件 ,最 ...

  2. php安装扩展模块后,重启不生效的原因及解决办法

    在lnmp运维环境中,我们经常会碰到有些php依赖的扩展模块没有安装,这就需要后续添加这些扩展模块.在扩展被安装配置后,往往会发现php-fpm服务重启后,这些扩展并没有真正加载进去!下面就以一个示例 ...

  3. 要想重启后也生效LINUX防火墙配置

    新配置的一台服务器,安装的是CentOS6.3系统,在安装完LNMP之后,发现nginx进程存在,且php解析正常,但是用分配的独立IP去访问的时候发现无法访问. 查了下网上的资料,发现可能是Linu ...

  4. Mac下配置环境变量重启后不生效解决(.bash_profile vs .bashrc)(bash/zsh下不加载.bashrc问题解决)

    参考上一篇文章说明:http://www.cnblogs.com/EasonJim/p/6283094.html 得知加载顺序如下: /etc/profile /etc/paths ~/.bash_p ...

  5. WIN10重启后,在任务栏下添加快捷工具栏消失问题修复

    WIN10重启后,在任务栏下添加快捷工具栏消失问题修复 可以在windows 设置 - - 设备 - - 输入 - - 高级键盘设置 - - 不要勾选 <使用桌面语言栏(如果可用 )>

  6. IDEA中使用Lombok时候,getter,setter注解不生效/每次重启后才生效

    Relevance.java代码如下: import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; imp ...

  7. [转] Centos 系统swap虚拟内存添加与删除配置

    [From]https://blog.csdn.net/lengyue1084/article/details/51405640 [From]https://yuukis.cn/24/ SWAP是Li ...

  8. CentOS 7 为firewalld添加开放端口及相关资料

    1.运行.停止.禁用firewalld 启动:# systemctl start  firewalld 查看状态:# systemctl status firewalld 或者 firewall-cm ...

  9. Linux新加磁盘挂载和重启自动挂载

    提示两点:*新加的硬盘需要重启服务器fdisk -l才能看到*下面操作要用root账户大概是这样的,查看-分区-格式化-挂载-重启自动挂载1.加硬盘后重启服务器查看[root@test199 ~]# ...

随机推荐

  1. Oracle数据库作业-3 查询

    1. 查询Student表中的所有记录的Sname.Ssex和Class列.

  2. Ajax学习笔记(一)

    来源:http://www.imooc.com/learn/250 Ajax不是某种编程语言,而是一种在无须重新加载整个网页的情况下能够更新部分网页的技术. 一.概念介绍--异步 利用XMLHttpR ...

  3. vs2013发布时: sgen.exe 已退出 代码为 1

    出现这个错的时候,有查网上的.自己也亲试了一下,注意两个地方就行. 红色框里设成这样的值就OK了!

  4. Android之开源项目优秀项目篇

    本文转自:http://www.trinea.cn/android/android-open-source-projects-excellent-project/ 记录的项目主要依据是项目有意思或项目 ...

  5. C#调用存储过程简单完整例子

    CREATE PROC P_TEST@Name VARCHAR(20),@Rowcount INT OUTPUTASBEGIN SELECT * FROM T_Customer WHERE NAME= ...

  6. WCF学习笔记(2)——使用IIS承载WCF服务

    通过前面的笔记我们知道WCF服务是不能独立存在,必须“寄宿”于其他的应用程序中,承载WCF服务的应用程序我们称之为“宿主”.WCF的多种可选宿主,其中比较常见的就是承载于IIS服务中,在这里我们来学习 ...

  7. 搭建Cocos Code IDE开发环境

    Cocos Code IDE是Cocos2d-x团队开发的,用于开发Cocos2d-JS和Cocos2d-x Lua绑定的游戏工具,它是基于Eclipse[ Eclipse 是一个开放源代码的.基于J ...

  8. IOS自定义场景切换动画。

    IOS中我们可以通过Storyborad以及segue来实现我们自己的场景切换动画,新建项目使用Single View Application模板并取名为MyCustomSegue. 使用storyb ...

  9. UI4_UIImageView

    // // ViewController.m // UI4_UIImageView // // Created by zhangxueming on 15/7/1. // Copyright (c) ...

  10. trident 序列号问题

    在使用Storm的trident做流计算开发时,遇到一个诡异的问题: 我继承IPartitionedTridentSpout或者IOpaquePartitionedTridentSpout接口做事务型 ...