How can the label root be added to the ext2 filesystem on /dev/sda1?

A.

relabel /dev/sda1 root

B.

tune2fs -L root /dev/sda1

C.

echo 'root' > /proc/fs/sda1/label

D.

labelfs --device /dev/sda1 root

題解

選項 A,沒有「relabel」指令。

選項 B,「tune2fs」指令可以調整 ext 檔案系統的參數,其「-L」參數可以用來調整檔案系統的標籤。

選項 C,並不會有「/proc/fs/sda1/label」這樣的路徑。「/proc/fs」存放著 Linux 核心對於不同的特定檔案系統所使用的參數。

選項 D,沒有「labelfs」指令。

因此答案是選項「B」。