created: 2022-10-26T04:16:50.030Z

RaspberryPi でext4とsamba(cifs)をマウントするときのfstabの鉄板オプション(ansibleで設定)

とりあえず nofail は両方につけておいたほうがいい。

ext4

UUID=xxxxxxxx /mnt/hdd500GB ext4 nofail 0 0

samba(cifs)

//fileserver.local/share /mnt/fileserver-share cifs nofail,username=pi,password=raspberry,uid=1000,gid=1000 0 0

fstabへの書き方

構文エラーで起動しなくなるとかサブいので ansible 越しに設定するのが安心。

    - name: mount /mnt/hdd
      ansible.posix.mount:
        src: "UUID={{ hddcase_uuid }}"
        opts: nofail
        path: /mnt/hdd500GB
        fstype: ext4
        state: mounted
    - name: mount fileserver-share
      ansible.posix.mount:
        src: //fileserver.local/share
        path: /mnt/fileserver-share
        fstype: cifs
        opts: 'nofail,username=pi,password=raspberry,uid=1000,gid=1000'
        state: mounted

関連付け

人物表現辞典
[ad] 人物表現辞典
中村 明 (単行本)