欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Linux 磁盘格式化、挂载

程序员文章站 2024-03-09 10:25:41
...
#取消挂载
[[email protected] /]# umount /opt
umount: /opt: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
#强制取消挂载
[[email protected] /]# umount /opt -f
umount2: 设备或资源忙
umount: /opt: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount2: 设备或资源忙
#查看哪些进程占用该文件夹
[[email protected] /]# fuser -m /opt
/opt:               189688c189820c190111c190117c
#杀掉
[[email protected] /]# kill -9 189688 189820 190111 190117
[[email protected] /]# fuser -m /opt
[[email protected] /]# umount /opt
#mke2fs: inode数量小于 2^32 = 4294967296
[[email protected] /]# mke2fs -O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -i 4194304 /dev/sdb -N 4294967295
mke2fs 1.43.3 (04-Sep-2016)
 /dev/sdb 有一个 ext4 文件系统
 
创建含有 7324216320 个块(每块 4k)和 4291545600 个inode的文件系统
文件系统UUID:db805a53-64a2-46d4-9f92-38e97c99e092
超级块的备份存储于下列块: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
        102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
        2560000000, 3855122432, 5804752896

正在分配组表: 完成                            
正在写入inode表: 完成                            
创建日志(262144 个块)完成
写入超级块和文件系统账户统计信息: 已完成       
[[email protected] /]# mkdir /opt/disk
[[email protected] /]# chown -R nwom:nwom /opt/disk
[[email protected] /]# vi /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Thu Sep  1 21:10:23 2016
#
# 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
#
/dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
UUID=472161e5-934c-4fe0-8a0c-8108c6504287 /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_home /home                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_swap 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
/dev/sdb                /opt                    ext4    defaults        1 2
[[email protected] /]# mount /dev/sdb /opt/disk
[[email protected] /]# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   50G  4.6G   43G  10% /
tmpfs                          48G  228K   48G   1% /dev/shm
/dev/sda1                     485M   40M  420M   9% /boot
/dev/mapper/VolGroup-lv_home  221G   13G  198G   6% /home
/dev/sdb                       27T  1.1G   25T   1% /opt
[[email protected] /]# df -ia
Filesystem                       Inodes  IUsed      IFree IUse% Mounted on
/dev/mapper/VolGroup-lv_root    3276800 115048    3161752    4% /
proc                                  0      0          0     - /proc
sysfs                                 0      0          0     - /sys
devpts                                0      0          0     - /dev/pts
tmpfs                          12376269      6   12376263    1% /dev/shm
/dev/sda1                        128016     39     127977    1% /boot
/dev/mapper/VolGroup-lv_home   14680064  40378   14639686    1% /home
none                                  0      0          0     - /proc/sys/fs/binfmt_misc
gvfs-fuse-daemon                      0      0          0     - /root/.gvfs
/dev/sdb                     4291545600     11 4291545589    1% /opt

 

转载于:https://my.oschina.net/fengyunfu/blog/774959

上一篇: Linux分区,挂载点

下一篇: