centos 格式化分区

#格式化U盘,成fat32

fdisk -l 

#获取U盘设备信息

#Disk /dev/sdc: 16.0 GB, 16025387008 bytes, 31299584 sectors
#Units = sectors of 1 * 512 = 512 bytes
#Sector size (logical/physical): 512 bytes / 512 bytes
#I/O size (minimum/optimal): 512 bytes / 512 bytes
#Disk label type: dos
#Disk identifier: 0x456b933f

#Device Boot Start End Blocks Id System
#/dev/sdc1 2048 31299583 15648768 c W95 FAT32 (LBA)

fdisk  /dev/sdc

>>m #命令列表

>>p #分区信息

>>d #del分区

>>n #新建分区 >>p #主分区 >>e #逻辑分区

>>l #查看分区信息

>>c #对U盘分区进行fat32格式化

>>w #保存修改

>>q #退出

 

调整 /home分区大小

#查看挂载在/home的分区,因为/home 是逻辑分区

[root@localhost ~]# df -h |grep home
/dev/mapper/centos-home 100G 33M 100G 1% /home

#查看有没有用户占用/home

[root@localhost ~]# fuser -m /home

#没有则,卸载/home
[root@localhost ~]#umount /home

#删除原分区

[root@localhost ~]# lvremove /dev/centos/home 

#重新分区成100G

[root@localhost ~]# lvcreate -L 100G -n home centos

#格式化成xfs

[root@localhost ~]# mkfs.xfs /dev/centos/home

#重新挂载到/home

[root@localhost ~]# mount /dev/centos/home /home/

 

posted @ 2016-09-30 10:25  EPHUIZI  阅读(1063)  评论(0编辑  收藏  举报