xfs 筆記

列出 xfs partition 的 label

# xfs_admin -l /dev/sdc1
label = ""

重新命名 xfs partition 的 label 最長只能 12 字元

# xfs_admin -L liho_tw_disk1 /dev/sdc1
writing all SBs
xfs_admin: truncating label length from 13 to 12
new label = "liho_tw_disk"

如果是使用 parted 建立的 partition table label (PARTLABEL) 名稱,需要用下列方式顯示:

# blkid -o export /dev/sdg1 | grep PARTLABEL
PARTLABEL=disk5

# lsblk -o partlabel /dev/sdg1
PARTLABEL
disk5

# blkid -s PART_ENTRY_NAME -p -o value /dev/sdg1
disk5

ps 上列硬碟原本是使用下列指令建立:

# parted /dev/sdg -a optimal --script mkpart disk5 xfs 0% 100%

所以用下列指令變更 partition table label :

# parted /dev/sdg --script name 1 liho_tw_disk5

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.