[root@cloud /]# passwd
更改用户 root 的密码 。
新的 密码:
重新输入新的 密码:
passwd: 所有的身份验证令牌已经成功更新。
[root@cloud /]# fdisk Usage:
fdisk [options] <disk> change partition table
fdisk [options] -l <disk> list partition table(s)
fdisk -s <partition> give partition size(s) in blocks Options:
-b <size> sector size (, , or )
-c switch off DOS-compatible mode
-h print help
-u <size> give sizes in sectors instead of cylinders
-v print version
-C <number> specify the number of cylinders
-H <number> specify the number of heads
-S <number> specify the number of sectors per track [root@cloud /]# fdisk -l Disk /dev/sda: 10.7 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00073ffb Device Boot Start End Blocks Id System
/dev/sda1 * Linux
Partition does not end on cylinder boundary.
/dev/sda2 8e Linux LVM Disk /dev/sdb: 53.7 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 Disk /dev/mapper/vg_cloud-lv_root: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 Disk /dev/mapper/vg_cloud-lv_swap: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 [root@cloud /]# df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/mapper/vg_cloud-lv_root
.5G .5G .7G % /
tmpfs 503M 72K 503M % /dev/shm
/dev/sda1 485M 32M 428M % /boot
[root@cloud /]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x6f476ca3.
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 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 (-) Invalid partition number for type `'
Command action
e extended
p primary partition (-)
p
Partition number (-):
First cylinder (-, default ):
Using default value
Last cylinder, +cylinders or +size{K,M,G} (-, default ):
Using default value Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table.
Syncing disks.
[root@cloud /]# fdisk -l Disk /dev/sda: 10.7 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00073ffb Device Boot Start End Blocks Id System
/dev/sda1 * Linux
Partition does not end on cylinder boundary.
/dev/sda2 8e Linux LVM Disk /dev/sdb: 53.7 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x6f476ca3 Device Boot Start End Blocks Id System
/dev/sdb1 Linux Disk /dev/mapper/vg_cloud-lv_root: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 Disk /dev/mapper/vg_cloud-lv_swap: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 [root@cloud /]# mkfs.ext3 /dev/sdb1
mke2fs 1.41. (-May-)
文件系统标签=
操作系统:Linux
块大小= (log=)
分块大小= (log=)
Stride= blocks, Stripe width= blocks
inodes, blocks
blocks (5.00%) reserved for the super user
第一个数据块=
Maximum filesystem blocks=
block groups
blocks per group, fragments per group
inodes per group
Superblock backups stored on blocks:
, , , , , , , , ,
, , 正在写入inode表: 完成
Creating journal ( blocks): 完成
Writing superblocks and filesystem accounting information: 完成 This filesystem will be automatically checked every mounts or
days, whichever comes first. Use tune2fs -c or -i to override.
[root@cloud /]# ls
bin dev home lost+found media2 mnt opt root selinux sys usr
boot etc lib media misc net proc sbin srv tmp var
[root@cloud /]# cd home
[root@cloud home]# ls
[root@cloud home]# ls -a
. ..
[root@cloud home]# cd ..
[root@cloud /]# mount /dev/sdb1 /home/
[root@cloud /]# df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/mapper/vg_cloud-lv_root
.5G .4G .7G % /
tmpfs 503M 72K 503M % /dev/shm
/dev/sda1 485M 32M 428M % /boot
/dev/sdb1 50G 180M 47G % /home
[root@cloud /]# echo "/dev/sdb1 /home ext3 defaults 1 1" >> /etc/fstab
[root@cloud /]# reboot Broadcast message from root@cloud
(/dev/pts/) at : ... 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. 转:视频压缩的基本概念(x264解压包)

    第1页:前言——视频压缩无处不在H.264 或者说 MPEG-4 AVC 是目前使用最广泛的高清视频编码标准,和上一代 MPEG-2.h.263/MPEG-4 Part4 相比,它的压缩率大为提高,例 ...

  2. 自定义按钮设置BadgeNumber

    TabbarButton.h @interface TabbarButton : UIButton @property (nonatomic, strong) UIButton *badgeValue ...

  3. 真机调试时提示: could not change executable permissions on the application

    原因:同一个bundle identifier不能重复在两个app中使用: 解决:卸载掉手机上的另一个app即可重新安装.

  4. Angularjs 中使用指令绑定点击事件

    项目中,模板中的菜单是jQuery控制的,在Angularjs中就运行不到了,因为菜单项是ng-repeat之后的. 如html <ul id="main-menu"> ...

  5. Unity之读取本地图片

    1.下载Opencv for unity. 2.把OpenCVForUnity下的StreamingAssets拖到Assets下. 3.点击Tools->opencv for unity-&g ...

  6. 使用ambari搭建Hadoop平台

    1.操作系统 CentoOS Server with GUI(有GUI,有浏览器*ambari基于浏览器*推荐latest stable version)2.分区 默认 + /hadoop3.网络设置 ...

  7. 关于Windows® API Code Pack for Microsoft® .NET Framework

    相比之前的操作系统,Window 7(or Vista)提供了很多新特性,我们在应用实现中可以利用这些特性来提升用户体验. 这些特性主要包括以下几个方面: Shell Enhancements Dir ...

  8. C#创建Windows服务入门图解(VS2010)

    C#创建Windows服务入门图解(VS2010) Windows服务大家都知道,比如Audio.Theme都是大家比较熟悉的服务,他们可以设为自动启动的,并且在注册表的开机自启动项里是没有痕迹的.所 ...

  9. [Android开发系列]IT博客应用V1.3

    首先,感谢使用这款软件并给我意见的朋友们,有你们的意见,才有了这个版本. 其次,检索功能和分类筛选功能(如果是你提的意见,记得在下面mark哦,毕竟读代码你能发现,其实发意见这个就是用自己的邮箱给自己 ...

  10. 华丽的HTML5/jQuery动画和应用 前端必备

    在网页应用中,我们经常会使用jQuery来实现一些简单的动画效果,比如菜单下拉时的渐变特效,图片滑动时的淡入淡出效果等.现在我们将jQuery和HTML5互相结合,让HTML5/CSS3强大的页面渲染 ...