LoginSignup
34
18

More than 5 years have passed since last update.

ubuntuで内蔵HDDを自動マウントする

Last updated at Posted at 2018-01-14

内蔵HDDを起動毎に自動でマウントしたいと思うことがある.
備忘録として簡単にまとめる.

内蔵HDDの情報確認

$ sudo blkidでUUIDやフォーマット方法を確認する.

範囲を選択_001.png

ここで必要なのは,UUIDとTYPE.
今回は/dev/sdb3を常時マウントしたいので,sdb3のUUIDとTYPEを使う.

自動マウントしたいパーティションを書き込む

/etc/fstabに追記
sudo vi /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=5b9726db-9f59-470f-9272-2476153e5c35 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=6AE4-9387  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda7 during installation
UUID=e20e3ebc-fb16-4e86-96d0-039ed1c416ed none            swap    sw              0       0

UUID=2832585D325831D4   /mnt/dataset    ntfs    defaults        0       0

上記のように,マウントしたいパーティションの情報を追記する.
今回はoptionsをdefaults,dump,passをそれぞれ0,マウント先のディレクトリを/mnt/datasetに設定した.

マウントの確認

sudo mount -aでマウントされているか確認.

34
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34
18