fsck修复mktemp /tmp/setup.shXXXXXXXXXX失败的问题
今天正常打开terminal,第一句就是无法创建临时文件,解决方案如下:
- 在终端输入
cat /proc/mounts
查看哪个硬盘出现了挂载错误; - 我的错误如下:
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc
rw,nosuid,nodev,noexec,relatime 0 0 udev /dev devtmpfs
rw,relatime,size=4011164k,nr_inodes=1002791,mode=755 0 0 devpts
/dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
0 0 tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=805016k,mode=755 0 0
/dev/sda6 / ext4 ro,relatime,errors=remount-ro,data=ordered 0 0 none /sys/fs/cgroup tmpfs rw,relatime,size=4k,mode=755 0 0 none
/sys/fs/fuse/connections fusectl rw,relatime 0 0 none
/sys/kernel/debug debugfs rw,relatime 0 0 none /sys/kernel/security
securityfs rw,relatime 0 0 none /sys/firmware/efi/efivars efivarfs
rw,relatime 0 0 none /run/lock tmpfs
rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 none /run/shm tmpfs
rw,nosuid,nodev,relatime 0 0 none /run/user tmpfs
rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755 0 0 none
/sys/fs/pstore pstore rw,relatime 0 0 /dev/nvme0n1p8 /boot ext4
rw,relatime,data=ordered 0 0 /dev/nvme0n1p1 /boot/efi vfat
rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
0 0 /dev/nvme0n1p9 /home ext4 rw,relatime,data=ordered 0 0 binfmt_misc
/proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0
0 systemd /sys/fs/cgroup/systemd cgroup
rw,nosuid,nodev,noexec,relatime,name=systemd 0 0 gvfsd-fuse
/run/user/1000/gvfs fuse.gvfsd-fuse
rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
- 终端输入
sudo fsck /dev/sda6
自动修复sda6硬盘。