我在刚开始操作的时候找不到/dev/sdb(即使插入了U盘,也没出现)
经过翻阅网站,才知道要创建新的硬盘()
其余默认就行
文件系统的创建
# 1.查看新增硬盘的信息sudo fdisk -l# 2.文件系统创建的操作sudo mkfs -t ext2 /dev/sdb# 3. 确认 :y# 4. 在创建文件系统后,可采用e2label 命令在指定文件系统的卷标,#e2label命令的主要功能就是现实和命名未安装文件系统的卷标sudo e2label /dev/sdbsudo e2label /dev/sdb data1sudo e2label /dev/sdb输出:data1
文件系统的挂载
查看是否挂载,发现/dev/sdb未挂载
zjj@zjj-virtual-machine:/dev$ mountsysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)udev on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=1962340k,nr_inodes=490585,mode=755,inode64)devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=399016k,mode=755,inode64)/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755,inode64)cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=27431)mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)/var/lib/snapd/snaps/bare_5.snap on /snap/bare/5 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/core18_1705.snap on /snap/core18/1705 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/core18_2253.snap on /snap/core18/2253 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/core20_1270.snap on /snap/core20/1270 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/gnome-3-34-1804_24.snap on /snap/gnome-3-34-1804/24 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/gnome-3-34-1804_77.snap on /snap/gnome-3-34-1804/77 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/gnome-3-38-_87.snap on /snap/gnome-3-38-/87 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/gtk-common-themes_1506.snap on /snap/gtk-common-themes/1506 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/gtk-common-themes_1519.snap on /snap/gtk-common-themes/1519 type squashfs (ro,nodev,relatime,x-gdu.hide)fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)/var/lib/snapd/snaps/snap-store_433.snap on /snap/snap-store/433 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/snapd_7264.snap on /snap/snapd/7264 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/snapd_14295.snap on /snap/snapd/14295 type squashfs (ro,nodev,relatime,x-gdu.hide)/var/lib/snapd/snaps/snap-store_558.snap on /snap/snap-store/558 type squashfs (ro,nodev,relatime,x-gdu.hide)vmware-vmblock on /run/vmblock-fuse type fuse.vmware-vmblock (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=399012k,mode=700,uid=1000,gid=1000,inode64)gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)/dev/sr0 on /media/zjj/Ubuntu 20.04 LTS amd64 type iso9660 (ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400,iocharset=utf8,uhelper=udisks2)/dev/fuse on /run/user/1000/doc type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,nodev,noexec,relatime,size=399016k,mode=755,inode64)nsfs on /run/snapd/ns/snap-store.mnt type nsfs (rw)
执行挂载,将建立目录/dev/sdb ,并将/dev/挂载到/data1目录下。
zjj@zjj-virtual-machine:/dev$ sudo mkdir /data1zjj@zjj-virtual-machine:/dev$ sudo mount /dev/sdb /data1/# 查看是否挂载成功------------发现下图中出现/dev/sdbzjj@zjj-virtual-machine:/dev$ mount
# 在文件夹/data1下建立测试文件夹testdir ls-l 查看文件夹信息,可以看到挂载成功zjj@zjj-virtual-machine:/dev$ sudo mkdir /data1/testdirzjj@zjj-virtual-machine:/dev$ ls -l /data1/总用量 20drwx------ 2 root root 16384 12月 15 13:44 lost+founddrwxr-xr-x 2 root root 4096 12月 15 13:58 testdirzjj@zjj-virtual-machine:/dev$ sudo umount /dev/sdb# 再次查看zjj@zjj-virtual-machine:/dev$ mount
# 查看zjj@zjj-virtual-machine:/dev$ ls -l /data1/总用量 0