激活交换分区、我不知道如何编辑fstab

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

激活交换分区、我不知道如何编辑fstab

#1

帖子 寺島聰子 » 2018-03-08 23:21

https://help.ubuntu.com/community/SwapF ... ange_it.3F
Activating the swap partition
Run gksu gedit /etc/fstab & and look for the line that has *swap* in it.

----------------------------------------------------------------
# /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
It should be the third column, separated by spaces or tabs.
最初何のことかぜんぜん意味が取れなかった。今突然わかった。
首先我无法理解。 我突然明白了。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 激活交换分区、我不知道如何编辑fstab

#2

帖子 poloshiao » 2018-03-09 7:47

# swap was on /dev/sda5 during installation  この行が編集されるべきターゲットなのか?這一行是要編輯的目標嗎?
# UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0
1. This line

代码: 全选

# swap was on /dev/sda5 during installation
is for comment or memory or note.
So # could not be removed always.

2. This line
# UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0
is the target to be edited. for examples :
2-1. purpose for comment or memory or note
# UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0
2-2. purpose to Activate the swap partition with UUID b27697f1-613f-485f-be6e-e1e5b65f1b14 at boot process.
UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0
It should be the third column, separated by spaces or tabs.
3. "the third column" means :
3-1.
----------------------------------------------------------------
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>

3-2.
UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0

4. for advanced reference :
4-1. http://manpages.ubuntu.com/manpages/xen ... tab.5.html
fstab - static information about the filesystems
The third field (fs_vfstype)
An entry swap denotes a file or partition to be used for swapping, cf. swapon(8). An entry none is useful for bind or move mounts.
More than one type may be specified in a comma-separated list.
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 激活交换分区、我不知道如何编辑fstab

#3

帖子 寺島聰子 » 2018-03-10 0:56

成功!激活交换分区、编辑fstab!

我做到了。。。 詳細的報告在午夜很疲憊,所以明天

About this time, I learned most of the content of poloshiao's writing.

なぜならば、あなたは、私がどの点が理解できずに躓いているかを、完璧に把握してくれたからです。
Because you perfectly grasp what I am crying without understanding.

代码: 全选

m@m ~ $ cat /proc/swaps
Filename				Type		Size	Used	Priority
/dev/sda6                               partition	4624380	0	-1
m@m ~ $ sudo blkid
[sudo] password for m: 
/dev/sda1: LABEL="mint2" UUID="3fb1c77c-7d46-4243-a955-790755e6023b" TYPE="ext4" 
/dev/sda5: LABEL="ubuntu" UUID="fdbadeb3-1cf6-4d23-9a83-61d080ba2afe" TYPE="ext4" 
/dev/sda6: UUID="2dccb008-c8e6-48a3-bea5-058ed3624727" TYPE="swap" 
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 激活交换分区、我不知道如何编辑fstab

#4

帖子 poloshiao » 2018-03-10 11:32

成功!激活交换分区、编辑fstab!
:em11
回复