sudo blkid /dev/sdc1LinuxのmountのTips
コマンドラインでマウントしたい
code:bash
$ sudo fdisk -l # /dev/sda2などの確認
$ sudo blkid /dev/sda2 # uuid確認
接続されたデバイスを確認したい
デバイスの名前(label)で確認
code: bash
ls /dev/disk/by-label/ # デバイスラベルがシンボリックリンクで存在する
ls -l /dev/disk/by-label/ # デバイスラベルからデバイスファイルへの参照確認
デバイスファイルごとの情報を確認
code:bash
fdisk -l # デバイス情報を取得
UUIDやラベルからデバイスファイルを取得
code:bash
blkid # デバイスごとにUUIDやラベル名、ファイルシステムなどの情報を表示
blkid --uuid <uuid> # uuidを用いてデバイスファイル名を取得
自動マウント
code:bash
$ sudo blkid /dev/sdc1
/dev/sdc1: LABEL="BarraCuda2TB" BLOCK_SIZE="512" UUID="069892E12C58CAD4" TYPE="ntfs" PARTUUID="8ab33f42-08ac-4ac2-9d12-23f7f4d8bd66"
UUIDが069892E12C58CAD4であることが分かる。このUUIDを使って、/etc/fstabを設定する。
code:text
# /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/sda2 during installation
UUID=f5bd1a4b-d4fd-4b56-8012-2f76d2b9ecca / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=B0FC-095E /boot/efi vfat umask=0077 0 1
# swap was on /dev/sda3 during installation
UUID=61e9a138-a057-429a-bf7a-1d216f1c622b none swap sw 0 0
# BarraCuda2TB (追記)
UUID=069892E12C58CAD4 /mnt/BarraCuda-NTFS ntfs-3g nofail,permissions 0 0
UUID=b842ad78-4157-44a9-936c-a2dadbc05288 /mnt/BarraCuda-EXT4 ext4 nofail 0 0
hr.icon