shell safely remove USB flash disk
2013-10-16 17:21
375 查看
Linux (Ubuntu): safely remove USB flash disk via command line
http://stackoverflow.com/questions/13224509/linux-ubuntu-safely-remove-usb-flash-disk-via-command-line
You can do this using udisks. it is not installed by default but easy enough to install (the package is like a meg in size once installed)...
sudo apt-get install udisks
Once installed you can detach a USB drive with the following commands...
sudo udisks --unmount /dev/sdb1
sudo udisks --detach /dev/sdb
The first line unmounts it. Just like any other partition you can still remount it at this point. The second line detaches it. After this it is powered down and you have to remove/reinsert it to remount.
To clarify sdb is the device and sdb1/2/3/etc are partitions on the device. Also, you will need to unmount all mount points before you attempt to detach the device. Usually with a USB stick/drive there is only one but it is a warning you should know about none the less.
Getting the device name from the mount point would require you pull it from mount or something.
http://stackoverflow.com/questions/13224509/linux-ubuntu-safely-remove-usb-flash-disk-via-command-line
You can do this using udisks. it is not installed by default but easy enough to install (the package is like a meg in size once installed)...
sudo apt-get install udisks
Once installed you can detach a USB drive with the following commands...
sudo udisks --unmount /dev/sdb1
sudo udisks --detach /dev/sdb
The first line unmounts it. Just like any other partition you can still remount it at this point. The second line detaches it. After this it is powered down and you have to remove/reinsert it to remount.
To clarify sdb is the device and sdb1/2/3/etc are partitions on the device. Also, you will need to unmount all mount points before you attempt to detach the device. Usually with a USB stick/drive there is only one but it is a warning you should know about none the less.
Getting the device name from the mount point would require you pull it from mount or something.
相关文章推荐
- Remove USB Device Safely
- 100%成功制作usb-hdd模式引导的U盘(usb flash disk)引导系统
- How To Create USB Dos Boot Disk
- 【Educational Codeforces Round 3 A】【水题 排序】USB Flash Drives 最少数量U盘存储m大小文件
- TP-LINK WR720N升级8M Flash 64M Ram,加USB-TTL,烧openwrt官方固件,接蓝牙适配器
- USB Flash Drives(水题,排序)
- Bootable USB Flash Drive for ESXi installation
- How to create a "BOOT USB DISK" for EXSI6.0
- some shell command that may help when umounting a usb device
- [原创] 树莓派 shell 重启 USB 设备
- python remove a element safely 安全地删除列表中的元素
- USB Device arrival or remove ( delphi )
- Codeforces Educational Codeforces Round 3 A. USB Flash Drives 水题
- USB Flash Drives
- Maste Note for OCR / Vote disk Maintenance Operations (ADD/REMOVE/REPLACE/MOVE)
- (CodeForces - 609A)USB Flash Drives
- Flashsim + Disksim 安装 固态硬盘模拟器
- Mongodb remove needs a query at src/mongo/shell/collection.js:299
- python remove a element safely 安全地删除列表中的元素
- Remove Antivirus XP Hard Disk Repair v9