东阳的学习记录,坚持就是胜利!
在对系统文件进行修改之前一定要先备份
不要使用ubuntu自带的图形界面操作!!!他做了什么你根本不知道!
fstab文件
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=4C84-2D9C /boot/efi vfat umask=0077,noauto 0 1
/dev/sda2 / ext4 defaults 0 0
/swapfile none swap sw 0 0
以/dev/sda2 / ext4 defaults 0 0为例:
- 第1列是需要挂载的文件系统或存储设备
- 第2列是挂载点
- 第3列指定文件系统或分区的类型
- 第4列为挂载选项,下面列出一些常用的选项:
auto: 系统自动挂载,fstab默认就是这个选项
ro: read-only
rw: read-write
defaults: rw, suid, dev, exec, auto, nouser, and async. - 第5列为dump选项,设置是否让备份程序dump备份文件系统,0为忽略,1为备份。
- 第6列为fsck选项,告诉fsck程序以什么顺序检查文件系统,0为忽略。
挂载新硬盘
配置虚拟内存
虚拟内存卸载
sudo swapoff swapfile