Ubuntu下自动挂载分区

时间:2022-06-01 12:42:15

参考文章:http://feierky.iteye.com/blog/1998602

1、查看分区的UUID

sudo blkid

/dev/sda1: UUID="3526b254-3907-4782-bb58-9841ce267539" TYPE="ext4"
/dev/sda5: UUID="7b18c20c-833f-404f-9914-edb8d7c61901" TYPE="swap"
/dev/sda6: UUID="ce6c454b-36c6-448b-bcac-ad139d1cf51b" TYPE="ext4"
/dev/sdb1: LABEL="OldSystem" UUID="522932b7-efbc-48e5-88aa-e8931133dbd4" TYPE="ext4"
/dev/sdb5: UUID="d863d346-730a-4e24-9271-5d9e159cf767" TYPE="swap"
/dev/sdb6: LABEL="OldWork" UUID="fd6a55f6-947c-472a-b102-9e3220fed88f" TYPE="ext4"

2、修改/etc/fstab文件,添加需要自动挂载的分区

UUID=fd6a55f6-947c-472a-b102-9e3220fed88f    /workOld    ext4    auto    0    0