swap

scipy@ubuntu:/$ ll
total 970056
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ./
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ../
drwxr-xr-x   2 root root      4096 Jun  7 06:19 bin/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 boot/
drwxr-xr-x  18 root root      3900 Jun 17 03:18 dev/
drwxr-xr-x  88 root root      4096 Jun 17 03:23 etc/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 home/
lrwxrwxrwx   1 root root        33 Jun  7 03:56 initrd.img -> boot/initrd.img-4.10.0-19-generic
drwxr-xr-x  19 root root      4096 Jun  8 01:43 lib/
drwxr-xr-x   2 root root      4096 Jun  7 03:55 lib64/
drwx------   2 root root     16384 Jun  7 03:54 lost+found/
drwxr-xr-x   4 root root      4096 Jun  7 03:55 media/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 mnt/
drwxr-xr-x   2 root root      4096 Jun  7 04:50 opt/
dr-xr-xr-x 178 root root         0 Jun 17 03:18 proc/
drwx------   2 root root      4096 Jun 17 03:24 root/
drwxr-xr-x  21 root root       620 Jun 17 03:25 run/
drwxr-xr-x   2 root root      4096 Jun  7 06:19 sbin/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 srv/
-rw-------   1 root root 993244160 Jun  7 03:54 swapfile
dr-xr-xr-x  13 root root         0 Jun 17 03:18 sys/
drwxrwxrwt  12 root root      4096 Jun 17 03:25 tmp/
drwxr-xr-x  10 root root      4096 Jun  7 03:55 usr/
drwxr-xr-x  12 root root      4096 Jun 13 19:48 var/
lrwxrwxrwx   1 root root        30 Jun  7 03:56 vmlinuz -> boot/vmlinuz-4.10.0-19-generic
scipy@ubuntu:/$ su
Password: 
root@ubuntu:/# chmod 777 swapfile
root@ubuntu:/# ll
total 970056
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ./
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ../
drwxr-xr-x   2 root root      4096 Jun  7 06:19 bin/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 boot/
drwxr-xr-x  18 root root      3900 Jun 17 03:18 dev/
drwxr-xr-x  88 root root      4096 Jun 17 03:23 etc/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 home/
lrwxrwxrwx   1 root root        33 Jun  7 03:56 initrd.img -> boot/initrd.img-4.10.0-19-generic
drwxr-xr-x  19 root root      4096 Jun  8 01:43 lib/
drwxr-xr-x   2 root root      4096 Jun  7 03:55 lib64/
drwx------   2 root root     16384 Jun  7 03:54 lost+found/
drwxr-xr-x   4 root root      4096 Jun  7 03:55 media/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 mnt/
drwxr-xr-x   2 root root      4096 Jun  7 04:50 opt/
dr-xr-xr-x 180 root root         0 Jun 17 03:18 proc/
drwx------   2 root root      4096 Jun 17 03:24 root/
drwxr-xr-x  21 root root       620 Jun 17 03:26 run/
drwxr-xr-x   2 root root      4096 Jun  7 06:19 sbin/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 srv/
-rwxrwxrwx   1 root root 993244160 Jun  7 03:54 swapfile*
dr-xr-xr-x  13 root root         0 Jun 17 03:18 sys/
drwxrwxrwt  12 root root      4096 Jun 17 03:26 tmp/
drwxr-xr-x  10 root root      4096 Jun  7 03:55 usr/
drwxr-xr-x  12 root root      4096 Jun 13 19:48 var/
lrwxrwxrwx   1 root root        30 Jun  7 03:56 vmlinuz -> boot/vmlinuz-4.10.0-19-generic
root@ubuntu:/# sudo rm swapfile
rm: cannot remove 'swapfile': Operation not permitted
root@ubuntu:/# cat swapfile
:3?@86En??茌SWAPSPACE2

^C
root@ubuntu:/# ll
total 970056
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ./
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ../
drwxr-xr-x   2 root root      4096 Jun  7 06:19 bin/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 boot/
drwxr-xr-x  18 root root      3900 Jun 17 03:18 dev/
drwxr-xr-x  88 root root      4096 Jun 17 03:23 etc/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 home/
lrwxrwxrwx   1 root root        33 Jun  7 03:56 initrd.img -> boot/initrd.img-4.10.0-19-generic
drwxr-xr-x  19 root root      4096 Jun  8 01:43 lib/
drwxr-xr-x   2 root root      4096 Jun  7 03:55 lib64/
drwx------   2 root root     16384 Jun  7 03:54 lost+found/
drwxr-xr-x   4 root root      4096 Jun  7 03:55 media/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 mnt/
drwxr-xr-x   2 root root      4096 Jun  7 04:50 opt/
dr-xr-xr-x 180 root root         0 Jun 17 03:18 proc/
drwx------   2 root root      4096 Jun 17 03:24 root/
drwxr-xr-x  21 root root       620 Jun 17 03:27 run/
drwxr-xr-x   2 root root      4096 Jun  7 06:19 sbin/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 srv/
-rwxrwxrwx   1 root root 993244160 Jun  7 03:54 swapfile*
dr-xr-xr-x  13 root root         0 Jun 17 03:18 sys/
drwxrwxrwt  12 root root      4096 Jun 17 03:27 tmp/
drwxr-xr-x  10 root root      4096 Jun  7 03:55 usr/
drwxr-xr-x  12 root root      4096 Jun 13 19:48 var/
lrwxrwxrwx   1 root root        30 Jun  7 03:56 vmlinuz -> boot/vmlinuz-4.10.0-19-generic
root@ubuntu:/# cd tmp
root@ubuntu:/tmp# ll
total 48
drwxrwxrwt 12 root root 4096 Jun 17 03:27 ./
drwxr-xr-x 22 root root 4096 Jun  7 03:56 ../
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .font-unix/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .ICE-unix/
drwx------  3 root root 4096 Jun 17 03:18 systemd-private-c6513a20a62f42b09f6d0104887c5a9c-apache2.service-zqgAyn/
drwx------  3 root root 4096 Jun 17 03:18 systemd-private-c6513a20a62f42b09f6d0104887c5a9c-systemd-resolved.service-lh1NTN/
drwx------  3 root root 4096 Jun 17 03:18 systemd-private-c6513a20a62f42b09f6d0104887c5a9c-systemd-timesyncd.service-G0iEvf/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .Test-unix/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 VMwareDnD/
drwx------  2 root root 4096 Jun 17 03:18 vmware-root/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .X11-unix/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .XIM-unix/
root@ubuntu:/tmp# ll
total 48
drwxrwxrwt 12 root root 4096 Jun 17 03:27 ./
drwxr-xr-x 22 root root 4096 Jun  7 03:56 ../
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .font-unix/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .ICE-unix/
drwx------  3 root root 4096 Jun 17 03:18 systemd-private-c6513a20a62f42b09f6d0104887c5a9c-apache2.service-zqgAyn/
drwx------  3 root root 4096 Jun 17 03:18 systemd-private-c6513a20a62f42b09f6d0104887c5a9c-systemd-resolved.service-lh1NTN/
drwx------  3 root root 4096 Jun 17 03:18 systemd-private-c6513a20a62f42b09f6d0104887c5a9c-systemd-timesyncd.service-G0iEvf/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .Test-unix/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 VMwareDnD/
drwx------  2 root root 4096 Jun 17 03:18 vmware-root/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .X11-unix/
drwxrwxrwt  2 root root 4096 Jun 17 03:18 .XIM-unix/
root@ubuntu:/tmp# cd ..
root@ubuntu:/# ll
total 970056
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ./
drwxr-xr-x  22 root root      4096 Jun  7 03:56 ../
drwxr-xr-x   2 root root      4096 Jun  7 06:19 bin/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 boot/
drwxr-xr-x  18 root root      3900 Jun 17 03:18 dev/
drwxr-xr-x  88 root root      4096 Jun 17 03:23 etc/
drwxr-xr-x   3 root root      4096 Jun  7 04:20 home/
lrwxrwxrwx   1 root root        33 Jun  7 03:56 initrd.img -> boot/initrd.img-4.10.0-19-generic
drwxr-xr-x  19 root root      4096 Jun  8 01:43 lib/
drwxr-xr-x   2 root root      4096 Jun  7 03:55 lib64/
drwx------   2 root root     16384 Jun  7 03:54 lost+found/
drwxr-xr-x   4 root root      4096 Jun  7 03:55 media/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 mnt/
drwxr-xr-x   2 root root      4096 Jun  7 04:50 opt/
dr-xr-xr-x 180 root root         0 Jun 17 03:18 proc/
drwx------   2 root root      4096 Jun 17 03:24 root/
drwxr-xr-x  21 root root       620 Jun 17 03:27 run/
drwxr-xr-x   2 root root      4096 Jun  7 06:19 sbin/
drwxr-xr-x   2 root root      4096 Apr 11 20:06 srv/
-rwxrwxrwx   1 root root 993244160 Jun  7 03:54 swapfile*
dr-xr-xr-x  13 root root         0 Jun 17 03:18 sys/
drwxrwxrwt  12 root root      4096 Jun 17 03:27 tmp/
drwxr-xr-x  10 root root      4096 Jun  7 03:55 usr/
drwxr-xr-x  12 root root      4096 Jun 13 19:48 var/
lrwxrwxrwx   1 root root        30 Jun  7 03:56 vmlinuz -> boot/vmlinuz-4.10.0-19-generic
root@ubuntu:/# swapoff /root/extraswap
swapoff: /root/extraswap: swapoff failed: No such file or directory
root@ubuntu:/# swapoff swapfile
root@ubuntu:/# rm swapfile
root@ubuntu:/# ll
total 84
drwxr-xr-x  22 root root  4096 Jun 17 03:29 ./
drwxr-xr-x  22 root root  4096 Jun 17 03:29 ../
drwxr-xr-x   2 root root  4096 Jun  7 06:19 bin/
drwxr-xr-x   3 root root  4096 Jun  7 04:20 boot/
drwxr-xr-x  18 root root  3900 Jun 17 03:18 dev/
drwxr-xr-x  88 root root  4096 Jun 17 03:23 etc/
drwxr-xr-x   3 root root  4096 Jun  7 04:20 home/
lrwxrwxrwx   1 root root    33 Jun  7 03:56 initrd.img -> boot/initrd.img-4.10.0-19-generic
drwxr-xr-x  19 root root  4096 Jun  8 01:43 lib/
drwxr-xr-x   2 root root  4096 Jun  7 03:55 lib64/
drwx------   2 root root 16384 Jun  7 03:54 lost+found/
drwxr-xr-x   4 root root  4096 Jun  7 03:55 media/
drwxr-xr-x   2 root root  4096 Apr 11 20:06 mnt/
drwxr-xr-x   2 root root  4096 Jun  7 04:50 opt/
dr-xr-xr-x 179 root root     0 Jun 17 03:18 proc/
drwx------   2 root root  4096 Jun 17 03:24 root/
drwxr-xr-x  21 root root   620 Jun 17 03:29 run/
drwxr-xr-x   2 root root  4096 Jun  7 06:19 sbin/
drwxr-xr-x   2 root root  4096 Apr 11 20:06 srv/
dr-xr-xr-x  13 root root     0 Jun 17 03:18 sys/
drwxrwxrwt  12 root root  4096 Jun 17 03:29 tmp/
drwxr-xr-x  10 root root  4096 Jun  7 03:55 usr/
drwxr-xr-x  12 root root  4096 Jun 13 19:48 var/
lrwxrwxrwx   1 root root    30 Jun  7 03:56 vmlinuz -> boot/vmlinuz-4.10.0-19-generic
root@ubuntu:/# 
原文地址:https://www.cnblogs.com/rsapaper/p/7041019.html