Re: list-harddrives/parted

"Jason L Tibbitts III" <[email protected]>
Newsgroups gmane.linux.redhat.kickstart.general
Message-ID <[email protected]>
>>>>> "MH" == Moray Henderson <[email protected]> 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<
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.