プログラミング

WSL Bashで外付けHDDを再読込みして認識させる

WindowsのWSL Linux Bashコマンドラインにおいて、外付けのHDD/SSDディスクが何らかの原因や取り出し、再起動などでWSL上で認識されなくなったような場合に、外付けHDDを再読込みして認識させます。

# 取り外したりするとエラーになってしまう
yuis on ASUS at /mnt/c/pg$ ls /mnt
ls: cannot access '/mnt/f': Invalid argument
total 0
  1407374883553285 drwxrwxrwx 1 yuis yuis 4096 Mar  6 14:36 h
  1407374883553285 drwxrwxrwx 1 yuis yuis 4096 Mar  6 14:36 g
  1407374883553285 drwxrwxrwx 1 yuis yuis 4096 Mar  6 14:35 e
  1407374883553285 drwxrwxrwx 1 yuis yuis 4096 Mar  6 14:35 c
   844424930322338 drwxr-xr-x 1 root root 4096 Jan  8 01:44 ..
   562949953696642 drwxr-xr-x 1 root root 4096 Jan  5 04:55 .
120189815055497884 drwxr-xr-x 1 root root 4096 Jan  5 04:55 _share3
367324844607452116 drwxr-xr-x 1 root root 4096 Jan  5 04:55 _share2
295267250570321447 drwxr-xr-x 1 root root 4096 Jan  3 04:19 _share
                 ? d????????? ? ?    ?       ?            ? f

# これでおk

sudo umount /mnt/f
sudo mount -t drvfs F: /mnt/f

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です