标签:uid super let == log 新分区 root and 内核
分区工具fdisk MBR(msdos)
1. 查看新设备是否发现
# fdisk -l 查看新分区标识
2. 分区
# fdisk /dev/sdb
Command (m for help): m
Command action
d delete a partition 删除分区
m print this menu
n add a new partition 添加分区
p print the partition table 显示分区表
q quit without saving changes
t change a partition‘s system id
w write table to disk and exit 保存退出
虚拟机不需要刷新,物理机分区之后需要刷新分区表
# partx -a /dev/sdb //让内核刷新分区表
# partprobe //让内核刷新分区表
3. 格式化(创建文件系统)
Windwos: FAT,FAT32,NTFS
Linux: VFAT,Ext2,Ext3,Ext4,GFS,GFS2
[root@localhost ~]# mkfs.ext4 /dev/sdb1 //100M的分区
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0) //块大小1024B (1K)
Fragment size=1024 (log=0)
25688 inodes, 102400 blocks.
9765 blocks (5.00%) reserved for the super user
4. 挂载
建立挂载点
# mkdir /mnt/disk1 //建立挂载点,挂载点建议是空目录
# mkdir /mnt/disk2
挂载
==手动: 临时
[root@localhost ~]# mount /dev/sdb1 /mnt/disk1
[root@localhost ~]# mount /dev/sdb2 /mnt/disk2
查看挂载:
[root@localhost ~]# mount
/dev/sdb1 on /mnt/disk1 type ext4 (ro)
/dev/sdb2 on /mnt/disk2 type ext4 (rw)
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sdb1 97M 5.6M 87M 7% /mnt/disk1
/dev/sdb2 1008M 34M 924M 4% /mnt/disk2
==开机自动挂载 /etc/fstab
/etc/fstab 填写格式:
设备名 挂载点名 格式化类型 权限(默认:defaults) 0 0
UUID
-------------------------------------------------------------------------------------------------------------------------------
[root@localhost ~]# blkid 查看每个设备UUID(唯一标识符)
/dev/sdb1: UUID="653a949d-ebf5-4543-9f67-4b71cbe5cf2b" TYPE="ext4"
/dev/sdb2: UUID="7ca49b1d-5359-413f-83aa-ed51c7421877" TYPE="ext4"
[root@localhost ~]# vim /etc/fstab
UUID="653a949d-ebf5-4543-9f67-4b71cbe5cf2b" /mnt/disk1 ext4 defaults 0 0
UUID="7ca49b1d-5359-413f-83aa-ed51c7421877" /mnt/disk2 ext4 defaults 0 0
[root@localhost ~]# mount -a //读取/etc/fstab并挂载
标签:uid super let == log 新分区 root and 内核
原文地址:https://www.cnblogs.com/MR-ws/p/11018838.html