My users have to wipe and format drives on an almost daily basis in a linux environment and they are not very apt with the command line. I want to build a tool that will let them plug in their external drive and run the tool and let it format it for them. This could include:

  • USB
  • HDD
  • SSD

I would have recommended GParted but there are more specific needs (INode settings etc) that need to be used that GParted doesn't support so I need to use Parted or something else.

My question would be what considerations would i need to take into account when singling out an external drive, that is without selecting an internal drive in the machine and accidentally wiping it!

I understand this may be difficult but i don't believe that it can't be done. Is there anything in linux (CentOS7) that points to unique elements of mounted drives? I was thinking of using UUID and storing the internal drive UUIDs in a json file to refer to but i feel this is too static and can cause a mishap.

I'm using python to build the script, i have a running script but the user must select a drive from the CLI and a single slip of a key could make a mistake, i dont want to give the user the option to make that kind of mistake.

  • 1
    You can set thinks up so that new drives belong to group floppy (rw), and built in drives are in group disk. Something about rules in USB sub-system. You then add your users to group floppy. – ctrl-alt-delor Feb 2 '18 at 18:55
  • Thanks for responding! How does one go about "grouping" drives? – jamalm Feb 5 '18 at 9:51
  • 1
    I don't know, but here is a similar question I asked a while ago unix.stackexchange.com/q/168176/4778 (you need to look at udev rules). – ctrl-alt-delor Feb 5 '18 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.