list-harddrives/parted

Jason L Tibbitts III tibbs at math.uh.edu
Thu Nov 15 14:58:45 UTC 2012


>>>>> "MH" == Moray Henderson <Moray.Henderson at ict-software.org> writes:

MH> Quick one (hopefully): can Anaconda's parted module (as used by
MH> list-harddrives, for example) distinguish between fixed and
MH> removable storage?

To get all of the non-removable disks, I just do:

for file in /sys/block/sd*; do
  rem=$(cat $file/removable)
  if [[ $rem == 0 ]]; then
    hds="$hds $(basename $file)"
  fi
done

Of course if you have some storage setup that presents disks with some
name other than sd* then you'll have to adjust that.

 - J<




More information about the Kickstart-list mailing list