從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#1

帖子 寺島聰子 » 2018-05-27 20:40

mint17.2とubuntu mate 16.04のデュアルブート。
ubuntu が操作不能に近い状態のため、mint17.2からマウントして管理者権限で作業。
ubuntu の/etc/fstabを開くと
Dual boot of mint 17.2 and ubuntu mate 16.04.
Because ubuntu is nearly inoperable, mount from mint 17.2 and work with administrator authority.
Open ubuntu / etc / 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/sda6 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none            swap    sw              0       0
なんかおかしい。まず、/dev/sda1: LABEL="mint2"  がない
有些事情是错的。 首先,没有/ dev / sda 1:LABEL =“mint 2”

$ sudo blkid

/dev/sda1: LABEL="mint2" UUID="3fb1c77c-7d46-4243-a955-790755e6023b" TYPE="ext4" PARTUUID="00077759-01"
/dev/sda5: LABEL="ubuntu" UUID="fdbadeb3-1cf6-4d23-9a83-61d080ba2afe" TYPE="ext4" PARTUUID="00077759-05"
/dev/sda6: UUID="4fb6dfed-1bc3-477a-8170-84e156766b4c" TYPE="swap" PARTUUID="00077759-06"
jin@1:~$
附件
Screenshot--dev-sda - GParted.png
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#2

帖子 poloshiao » 2018-05-27 21:06

Open ubuntu /etc/fstab
1. This file /etc/fstab is in ubuntu mate 16.04.
# / was on /dev/sda6 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe / ext4 errors=remount-ro 0 1
2. The dir / is mounted to /dev/sda6.
なんかおかしい。まず、/dev/sda1: LABEL="mint2"  がない
有些事情是错的。 首先,没有/ dev / sda 1:LABEL =“mint 2”
3. All other mounted items are optional except dir / line (mounted to /dev/sda6) which is indispensable.
Because ubuntu is nearly inoperable
4. The cause of being inoperable is not necessarily related to /dev/sda1.
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#3

帖子 寺島聰子 » 2018-05-27 23:22

2. The dir / is mounted to /dev/sda6.
3. All other mounted items are optional except dir / line (mounted to /dev/sda6) which is indispensable.
言われてることの1割か2割しか理解できない。ごめんなさい。
我只能理解所说的10%或20%。 我很抱歉。

b27697f1-613f-485f-be6e-e1e5b65f1b14

4fb6dfed-1bc3-477a-8170-84e156766b4c
に置換
------------------------------------------------
# /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/sda6 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
------------------------------------------------
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#4

帖子 poloshiao » 2018-05-28 10:33

b27697f1-613f-485f-be6e-e1e5b65f1b14

4fb6dfed-1bc3-477a-8170-84e156766b4c
に置換
viewtopic.php?p=3206052#p3206052
# swap was on /dev/sda5 during installation
UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0
viewtopic.php?p=3206058#p3206058
# swap was on /dev/sda5 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
viewtopic.php?p=3206052#p3206052
$ sudo blkid
/dev/sda5: LABEL="ubuntu" UUID="fdbadeb3-1cf6-4d23-9a83-61d080ba2afe" TYPE="ext4" PARTUUID="00077759-05"
Copy the following commands line by line and paste them into terminal then execute them :
以下のコマンドを1行ずつコピーして端末に貼り付けて実行してください
把下面指令 複製 貼進終端機 執行
1. sudo ls -al /dev/disk/by-uuid/*
2. sudo ls -al /dev/disk/by-partuuid/*
Copy commands and their outputs from terminal and paste them to this post.
端末からコマンドとその出力をコピーして、このポストに貼り付けてください
把指令及結果全部直接 選取/複製/貼上來
言われてることの1割か2割しか理解できない。ごめんなさい。
我只能理解所说的10%或20%。 我很抱歉。
# /etc/fstab: static file system information.
# / was on /dev/sda6 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe / ext4 errors=remount-ro 0 1
3. The above line (mounting /dev/sda6 to the mount point /) is "must have", i.e. indispensable.
3-1. Other lines like
# swap was on /dev/sda5 during installation
UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0
.....
.....
are all optional, i.e. could be added or removed manually.
(take effect after rebooting)

4. Other references:
4-1. https://help.ubuntu.com/community/Fstab
Fstab
4-2. https://help.ubuntu.com/community/Linux ... sExplained
LinuxFilesystemsExplained
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#5

帖子 寺島聰子 » 2018-05-30 13:03

体調不良のため、返信が遅くなり、ごめんなさい。よろしくお願いします。
由于身体状况不佳,我很迟才回复。 谢谢。
把下面指令 複製 貼進終端機 執行
1. sudo ls -al /dev/disk/by-uuid/*
2. sudo ls -al /dev/disk/by-partuuid/*
$ sudo ls -al /dev/disk/by-uuid/*
[sudo] password for m:
lrwxrwxrwx 1 root root 10 5月 30 13:14 /dev/disk/by-uuid/3fb1c77c-7d46-4243-a955-790755e6023b -> ../../sda1
lrwxrwxrwx 1 root root 10 5月 30 13:14 /dev/disk/by-uuid/4fb6dfed-1bc3-477a-8170-84e156766b4c -> ../../sda6
lrwxrwxrwx 1 root root 10 5月 30 13:14 /dev/disk/by-uuid/fdbadeb3-1cf6-4d23-9a83-61d080ba2afe -> ../../sda5
$ sudo ls -al /dev/disk/by-partuuid/*
ls: /dev/disk/by-partuuid/* にアクセスできません: そのようなファイルやディレクトリはありません
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#6

帖子 poloshiao » 2018-05-30 16:40

# /etc/fstab: static file system information.
# / was on /dev/sda6 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe / ext4 errors=remount-ro 0 1
sudo ls -al /dev/disk/by-uuid/*
lrwxrwxrwx 1 root root 10 5月 30 13:14 /dev/disk/by-uuid/fdbadeb3-1cf6-4d23-9a83-61d080ba2afe -> ../../sda5
sudo blkid
/dev/sda5: LABEL="ubuntu" UUID="fdbadeb3-1cf6-4d23-9a83-61d080ba2afe" TYPE="ext4" PARTUUID="00077759-05"
1. You must change the following two lines

代码: 全选

# / was on /dev/sda6 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe / ext4 errors=remount-ro 0 1
to

代码: 全选

# / was on /dev/sda5 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe / ext4 errors=remount-ro 0 1
# /etc/fstab: static file system information.
# swap was on /dev/sda5 during installation
UUID=b27697f1-613f-485f-be6e-e1e5b65f1b14 none swap sw 0 0
sudo ls -al /dev/disk/by-uuid/*
lrwxrwxrwx 1 root root 10 5月 30 13:14 /dev/disk/by-uuid/4fb6dfed-1bc3-477a-8170-84e156766b4c -> ../../sda6
sudo blkid
/dev/sda6: UUID="4fb6dfed-1bc3-477a-8170-84e156766b4c" TYPE="swap" PARTUUID="00077759-06"
2. You must change the following two lines

代码: 全选

# swap was on /dev/sda5 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
to

代码: 全选

# swap was on /dev/sda6 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
$ sudo ls -al /dev/disk/by-partuuid/*
ls: /dev/disk/by-partuuid/* にアクセスできません: そのようなファイルやディレクトリはありません
3. partuuid is for gpt partition.
3-1. There would be no partuuid for msdos (or mbr) partition.
viewtopic.php?p=3206052#p3206052
$ sudo blkid
/dev/sda5: LABEL="ubuntu" UUID="fdbadeb3-1cf6-4d23-9a83-61d080ba2afe" TYPE="ext4" PARTUUID="00077759-05"
3-2. PARTUUID="00077759-05"
why ?
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#7

帖子 寺島聰子 » 2018-05-30 18:07

​# /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).
# Nさんの指導で開始して、途中ワケわからんくなって、poloshiaoさんの
# 手取り足取りをそのまま、貼り付けた。2018/05/30 viewtopic.php?f=48&t=487615

# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=fdbadeb3-1cf6-4d23-9a83-61d080ba2afe / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0

------------------------------
3. partuuid is for gpt partition.
3-1. There would be no partuuid for msdos (or mbr) partition.
了解。
3-2. PARTUUID="00077759-05"
why ?

代码: 全选

$ sudo blkid
/dev/sda1: LABEL="mint2" UUID="3fb1c77c-7d46-4243-a955-790755e6023b" TYPE="ext4" PARTUUID="00077759-01"
/dev/sda5: LABEL="ubuntu" UUID="fdbadeb3-1cf6-4d23-9a83-61d080ba2afe" TYPE="ext4" PARTUUID="00077759-05"
/dev/sda6: UUID="4fb6dfed-1bc3-477a-8170-84e156766b4c" TYPE="swap" PARTUUID="00077759-06"
jin@1:~$
は、ubuntu mate 16.04上で実行しました

現在のmint17.2で実行すると

代码: 全选

$ 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="4fb6dfed-1bc3-477a-8170-84e156766b4c" TYPE="swap" 
$ 
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#8

帖子 poloshiao » 2018-05-30 19:50

sudo blkid
/dev/sda1: ... PARTUUID="00077759-01"
/dev/sda5: ... PARTUUID="00077759-05"
/dev/sda6: ... PARTUUID="00077759-06"
1. googled by PARTUUID 00077759
searching result :
找不到符合搜尋字詞「PARTUUID 00077759」的文件。

2. https://unix.stackexchange.com/question ... tion-table
What is PARTUUID from blkid when using msdos partition table?
Looks like the PARTUUID on a MBR-partitioned disk is the Windows Disk Signature from the MBR block (8 hex digits) + a dash + a two-digit partition number.
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#9

帖子 寺島聰子 » 2018-05-30 21:42

找不到符合搜尋字詞「PARTUUID 00077759」的文件。
jin@1:~$ sudo fdisk -l
[sudo] password for jin:
Disk /dev/sda: 74.5 GiB, 80032038912 bytes, 156312576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00077759

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 91521023 91518976 43.7G 83 Linux
/dev/sda2 91523072 156312575 64789504 30.9G 5 Extended
/dev/sda5 91527168 153352191 61825024 29.5G 83 Linux
/dev/sda6 153354240 156311551 2957312 1.4G 82 Linux swap / Solaris
jin@1:~$

Solaris!! :em05

-------------------------------------
今回の作業をしても、「起動直後1.1GBメモリ使用。もうすぐ大量のスワップで応答停止」の症状は、改善しない
即使這項工作已經完成,“啟動後立即停止使用1.1 GB內存並很快停止大量SWAP”的症狀不會改善

HELP ありがとうございます謝謝
附件
起動直後メモリ使用量<br />Memory usage immediately after startup
起動直後メモリ使用量
Memory usage immediately after startup
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#10

帖子 poloshiao » 2018-05-30 22:50

sudo blkid
/dev/sda1: ... PARTUUID="00077759-01"
/dev/sda5: ... PARTUUID="00077759-05"
/dev/sda6: ... PARTUUID="00077759-06"
sudo fdisk -l
...
Disk identifier: 0x00077759
1. Disk identifier: 0x00077759
/dev/sda6 153354240 156311551 2957312 1.4G 82 Linux swap / Solaris
https://en.wikipedia.org/wiki/Partition ... tition_IDs
List of partition IDs
...
82h : Swap / Solaris x86 / Prime Computer
2. The same Partition_type ID : 82h
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#11

帖子 寺島聰子 » 2018-06-03 9:50

おはようございます、復習です。
参考
http://www.itmedia.co.jp/enterprise/art ... 011_2.html
82h : Swap / Solaris x86 / Prime Computer
参考ページ中の文「また、SolarisのパーティーションにはLinuxのスワップ空間と同じIDが使用されるので、誤ってSolarisパーティーションを消さないようにも注意が必要だ。」から推測するに、これは単にLinuxのスワップ空間を示すに過ぎないみたいだ
正如您可以從參考頁中的句子中猜測的那樣“還要注意,Solaris分區使用與Linux交換空間相同的ID,因此必須注意不要意外刪除Solaris分區” 它似乎只顯示Linux的交換空間
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#12

帖子 寺島聰子 » 2018-06-03 10:02

スワップ空間の使用状況
交換空間的使用狀態
$ swapon -s
Filename Type Size Used Priority
/dev/sda6 partition 1478652 0 -1
$
無問題

$ gksu pluma /etc/fstab

# /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=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
#gksu pluma /etc/fstab &
/dev/shm /ramdisk tmpfs size=1024m 0 0
<ファイルシステム> <マウントポイント> <タイプ> <オプション> <ダンプ間隔> <パス番号>

 スワップ空間は特殊なタイプのファイルシステムなので、これらのパラメータの多くは適用できない。スワップ空間の場合は、次のように記述する。

/dev/hdb1 none swap sw 0 0

 「/dev/hdb1」がスワップパーティーション名である。スワップには特定のマウントポイントがないため、その部分は「none」となっている。タイプは「swap」、オプションは「sw」、また使用しない最後の2つのパラメータは「0」にしておく。
あれ?swapon -s の値と、fstabの​swap の位置が違いはしまいか?
那一個? swapon - s的值是否與fstab的交換位置不同?
$ 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="4fb6dfed-1bc3-477a-8170-84e156766b4c" TYPE="swap"
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#13

帖子 poloshiao » 2018-06-03 18:20

$ gksu pluma /etc/fstab
1. gksu is used when you logged-in with user root, that is not recommended.

2. gksudo is used when you logged-in with user non-root, that is recommended.
sudo blkid
/dev/sda6: UUID="4fb6dfed-1bc3-477a-8170-84e156766b4c" TYPE="swap" PARTUUID="00077759-06"
$ swapon -s
Filename Type Size Used Priority
/dev/sda6 partition 1478652 0 -1
# swap was on /dev/sda5 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
3. The line beginning with # means this line will be ignored.
i.e. this line
swap was on /dev/sda5 during installation
will be ignored.
あれ?swapon -s の値と、fstabの​swap の位置が違いはしまいか?
那一個? swapon - s的值是否與fstab的交換位置不同?
4. viewtopic.php?p=3206153#p3206153
You must change the following two lines

代码: 全选

# swap was on /dev/sda5 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
to

代码: 全选

# swap was on /dev/sda6 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
4-1. This line takes effect.
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
4-2. sudo swapon -s & /etc/fstab
is the same result : /dev/sda6.
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#14

帖子 寺島聰子 » 2018-06-10 7:30

引用:
$ gksu pluma /etc/fstab

1. gksu is used when you logged-in with user root, that is not recommended.

2. gksudo is used when you logged-in with user non-root, that is recommended.
我は、今この瞬間、ユーザーroot でログインしてない。ゆえに、「2. gksudo is used when you logged-in with user non-root, that is recommended.」ということだ。
しかし、その理由はなにか?gksu にはどんなリスクがあるのか?げんに何も起きてない。
Not well understood,
I am not logged in as user root at this moment. Therefore, "2. Gksudo is used when you logged - in with user non - root, that is recommended."
But what is the reason? What is the risk of gksu? Nothing has happened.
寺島聰子
帖子: 688
注册时间: 2016-06-03 14:39
系统: debian11 mate

Re: 從mint編輯ubuntu的/ etc / fstab,因為多引導的ubuntu幾乎不可操作

#15

帖子 寺島聰子 » 2018-06-10 8:51

You must change the following two lines
代碼:
# swap was on /dev/sda5 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0

to
代碼:
# swap was on /dev/sda6 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
$ gksudo pluma /etc/fstab
------------------------------------------------
過去
# /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=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
#gksu pluma /etc/fstab &
/dev/shm /ramdisk tmpfs size=1024m 0 0

------------------------------------------------
現在
​# /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/sda6 during installation
UUID=4fb6dfed-1bc3-477a-8170-84e156766b4c none swap sw 0 0
#gksu pluma /etc/fstab &
/dev/shm /ramdisk tmpfs size=1024m 0 0

以上2行、修正終わり
回复