Although the initial problem is solved I thought to ask a further question in this thread about incorporating this into a BASH script.
Not being a scripter I am a bit lost with how to achieve this .......
I want to find all the devices attached to the PC, so I use
$ sfdisk -s | grep -e /dev/ | cut -d: -f1
/dev/sda -> fixed disk
/dev/sdb -> fixed disk
/dev/sdd -> removable disk
$ sfdisk -s | grep -e /dev/ | cut -d: -f1 | cut -d / -f3
That is as it should be.
Next I want to display - maybe using Zenity - those devices to the user for them to select one.
Again not a problem ......
DRV=$(sfdisk -s | grep -e /dev/ | cut -d: -f1)
# omit removable drives from the list
DEVICE=$(zenity --height=300 --width=250 --list --title "Selection" \
--text " Please select a device " \
--column "Drive" $DRV )
What I would like to do is to omit those drives that are removable from the list presented to the user - in the above case that would be /dev/sdd.
Maybe checking against /sys/block/<drive>/removable ? where <drive> is sda, sdb, etc and not /dev/sda, /dev/sdb.
I would have a preference to not using files to store data ... just variables or such ... but if needs must ...
Pointers would be appreciated ....... I seem unable to get my head around this for some reason .... well maybe the reason is I do not know BASH
Thanks for any help.