LoginSignup
0
1

More than 5 years have passed since last update.

python > umountする > cmd=["umount", dstpath] / subprocess.Popen(cmd, bufsize=0)

Last updated at Posted at 2015-12-12
動作確認
Raspberry Pi2 + raspbian

ラインモニタのログフォルダのUSBコピー機能をテストしている中で、「フォルダ構造が壊れました。fsckしてください」のようなメッセージが出てきた。

やはりumountしないといけない。

umountの方法を色々試して、以下の実装に至った。

commit @ github

import subprocess

...
dstpath="/media/pi/COPYTO"
...

cmd=["umount", dstpath]
print cmd
subprocess.Popen(cmd, bufsize=0)

wait()がいるのかどうか未調査。

umountのみなので、サブプロセスはすぐに終了しているかと思うが。

0
1
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
0
1