How to format removable devices
Introduction
This script is for: CujoQuarrel and tedrogers
- This is a bash script that will unmount, format, and re-mount a removable device.
- You can add a menu item/desktop icon/launcher if you like.
- Although this is a bash script IT RUNS AS A GUI.
- Dependency : The only absolute dependency is zenity which is installed with a default Ubuntu (gnome) installation.
Not to state the obvious, but,
Caution: If you format a device/partition you will lose all the data in that partition. You have been warned....
How to install this script
- Download the attached file (Ubuntu_format.txt).
- Save it to /usr/bin as /usr/bin/format (you must sudo to do this).
- Alternately, as suggested by sebastjanp, you may save the script to your scripts directory.
- Make it executable.
Code:sudo chmod a+x /usr/bin/format
How to use this script
- IMO this script is best run in a terminal:
Code:gksudo format- Start the script with your device attached and mounted in /media
- You can also manually add a menu item, desktop icon, or launcher.
command: gksudo /usr/bin/format- At the end of the script your newly formatted device will be mounted, rw, at /media/new_format
- You should be able to umount as a user (from the desktop -> eject or in a terminal with pumount pumount /media/new_format/), but if you have problems,
Or, if all else fails:Code:sudo pumount /media/new_formatCode:sudo umount /media/new_format sudo rm -r /media/new_format
Enjoy
bodhi.zazen



bodhi.zazen
Adv Reply




Bookmarks