不能“禁用和删除交换文件”

Ubuntu各种衍生版本
回复
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

不能“禁用和删除交换文件”

#1

帖子 寺島聰子 » 2018-03-04 21:13

如果你迷路了,首先,你在迷路之前回到这个地方。
是一个规则
に従えば、swap partitionをやめてswap fileにしたことが、混迷の始まり。ゆえに
まず、スワップファイルを削除、とりあえずスワップ領域0の状態に持って行くことではないか?
mint17.2上において。(と現時点で考えました)
據說,交換分區的停止並將其作為交換文件是混亂的開始。因此
首先,是不是要刪除交換文件,暫時把它交換到交換區域0的狀態?
在mint17.2。 (我現在在想)

https://help.ubuntu.com/community/SwapF ... ange_it.3F
Disable and Remove a Swap File

Disable the swap file from the running system and the delete it:

sudo swapoff /mnt/1Gib.swap
sudo rm /mnt/1Gib.swap

Remove the swap file details from fstab:

gksudo gedit /etc/fstab

Removing the swap file line

/mnt/1GiB.swap swap swap defaults 0 0

代码: 全选

m@m ~ $ sudo swapoff /mnt/1Gib.swap
[sudo] password for m:
swapoff: /mnt/1Gib.swap: swapoff が失敗しました: そのようなファイルやディレクトリはありません
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 不能“禁用和删除交换文件”

#2

帖子 poloshiao » 2018-03-05 11:12

https://help.ubuntu.com/community/SwapF ... ap_file.3F
Example of making a swap file
$ reboot
$ free -h
total used free shared buff/cache available
Mem: 15G 9.3G 454M 4.0G 5.8G 1.9G
Swap: 1.0G 1.0G 0B
に従えば、swap partitionをやめてswap fileにしたことが、混迷の始まり。ゆえに
まず、スワップファイルを削除、とりあえずスワップ領域0の状態に持って行くことではないか?
mint17.2上において。(と現時点で考えました)
1. Translated to English by google :
According to, the stop of the swap partition and making it a swap file is the start of confusion. therefore
First of all, is not it to delete the swap file, take it to the state of swap area 0 for the time being?
On mint 17.2. (I thought at the moment)
1-1. Make sure the used column in Swap line become 0.0G
Swap: 1.0G 0.0G 1.0G
wapoff: /mnt/1Gib.swap: swapoff が失敗しました: そのようなファイルやディレクトリはありません
2. Translated to English by google :
wapoff: /mnt/1Gib.swap: swapoff failed: No such file or directory
https://help.ubuntu.com/community/SwapF ... ap_file.3F
Remove the swap file details from fstab:
gksudo gedit /etc/fstab
Removing the swap file line
/mnt/1GiB.swap swap swap defaults 0 0
2-1. This line was already removd from /etc/fstab and reboot ?
/mnt/1GiB.swap swap swap defaults 0 0

3. Remeber to :
3-1. Umount the swap partition before you want To Change / Delete any swap partition (including swap file)
3-2. Make sure the used space value be 0 before you want to umount the swap partition (including swap file)
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 不能“禁用和删除交换文件”

#3

帖子 寺島聰子 » 2018-03-06 18:06

2-1. This line was already removd from /etc/fstab and reboot ?
/mnt/1GiB.swap swap swap defaults 0 0
不也、poloshiao
3. Remeber to :
3-1. Umount the swap partition before you want To Change / Delete any swap partition (including swap file)
m@m ~ $ export LC_ALL=en_US.UTF-8​​
m@m ~ $ sudo swapoff /mnt/1Gib.swap
[sudo] password for m:
swapoff: /mnt/1Gib.swap: swapoff failed: No such file or directory
m@m ~ $
下が現在のfstabです。「swapoff failed: No such file or directory」の問題を解決するためには
どのswap partitionまたはswap fileをUmountしたらよいのですか?
恐縮ですが、手取り足取り、具体的な操作手順をお願いします。
Below is the current fstab. In order to solve the problem of "swapoff failed: No such file or directory"
Which swap partition or swap file should be Umounted?
I'm afraid that you will take a step forward, please give us specific instructions.

代码: 全选

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

#Entry for /dev/sda1 :
UUID=3fb1c77c-7d46-4243-a955-790755e6023b	/	ext4	errors=remount-ro	0	1
# swap was on /dev/sda5 during installation
# UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14	none	swap	sw	0	0

# swap file
/mnt/1GiB.swap none            swap    sw              0       0
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 不能“禁用和删除交换文件”

#4

帖子 poloshiao » 2018-03-06 19:07

the problem of "swapoff failed: No such file or directory"
Copy the following lines and paste them into terminal and then execute them separately :
1. free -m -t
2. sudo swapon -s
3. sudo cat /proc/swaps
4. sudo ls -al /mnt | grep swap
Copy all the outputs and paste them here.
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 不能“禁用和删除交换文件”

#5

帖子 寺島聰子 » 2018-03-06 21:20

代码: 全选

m@m ~ $ free -m -t
             total       used       free     shared    buffers     cached
Mem:          2001       1658        342         41         71        839
-/+ buffers/cache:        747       1253
Swap:         1023         53        970
Total:        3025       1712       1312
m@m ~ $ 

代码: 全选

m@m ~ $ sudo swapon -s
[sudo] password for m: 
Filename				Type		Size	Used	Priority
/mnt/1GiB.swap                          file		1048572	55116	-1
m@m ~ $ 

代码: 全选

m@m ~ $ sudo cat /proc/swaps
[sudo] password for m: 
Filename				Type		Size	Used	Priority
/mnt/1GiB.swap                          file		1048572	55116	-1
m@m ~ $ 

代码: 全选

m@m ~ $ sudo ls -al /mnt | grep swap
-rw-------  1 root root 1073741824 Feb 23 00:56 1GiB.swap
m@m ~ $
onlylove
论坛版主
帖子: 5215
注册时间: 2007-01-14 16:23

Re: 不能“禁用和删除交换文件”

#6

帖子 onlylove » 2018-03-06 21:42

linux is case sensitive, the file you create is /mnt/1GiB, and your command is
sudo swapoff /mnt/1Gib.swap
where it should be
sudo swapoff /mnt/1GiB.swap
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 不能“禁用和删除交换文件”

#7

帖子 寺島聰子 » 2018-03-06 22:22

ありがとうございました
非常感谢

代码: 全选

m@m ~ $ sudo swapoff /mnt/1GiB.swap
[sudo] password for m: 
m@m ~ $ sudo rm /mnt/1GiB.swap
m@m ~ $ gksudo pluma /etc/fstab
m@m ~ $
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>

#Entry for /dev/sda1 :
UUID=3fb1c77c-7d46-4243-a955-790755e6023b / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
# UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0

# swap file

代码: 全选

m@m ~ $ free -m -t
             total       used       free     shared    buffers     cached
Mem:          2001       1914         86         33        222        591
-/+ buffers/cache:       1100        900
Swap:            0          0          0
Total:        2001       1914         86

代码: 全选

m@m ~ $ sudo cat /proc/swaps
[sudo] password for m: 
Filename				Type		Size	Used	Priority
m@m ~ $ 
回复