设备的挂载
vim /root/diskpass
在server里做
系统分区
fdisk -l 查看真实存在的设备
/dev/xdx
/dev/hd0 并口
/dev/sda 串口 sata a表示第一块
/dev/cdrom /dev/sr0 光驱
/dev/mapper/ 虚拟出来的设备
df 正在使用
blkid 可以使用
cat /proc/partitions 系统识别
fdisk -l 查看真实存在
df -h 2的n次方 统计出来较下面小
df -H 10的n次方
设备的挂载与卸载
df查看正在使用的设备
插上u盘,再次df会发现多出设备
umount /dev/sdb1 卸载u盘设备
mount /dev/sdb1 装载u盘设备
mount /dev/sdb1 /mnt/ 装载u盘设备到/mnt/
再次df查看
/dev/sdb1 15307184 1123024 14184160 8% /mnt
cd进/mnt/
打开另一真机界面,切换超级用户
umount /mnt/ 无法卸载
[[email protected] ~]# umount /mnt/
umount: /mnt: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
可用fuser -kvm /dev/sdb1 卸载
在另一界面会发现
[[email protected] mnt]# Killed
给挂载设备权限
[[email protected] ~]# mount -o ro /dev/sdb1 /mnt/ 只读权限
[[email protected] ~]# touch /mnt/file
touch: cannot touch ‘/mnt/file’: Read-only file system
[[email protected] ~]# mount -o re mount,rw /dev/sdb1 读写权限