diff --git a/src/cryptobox/core/blockdevice.py b/src/cryptobox/core/blockdevice.py index ea0b2ad..0ebe35f 100644 --- a/src/cryptobox/core/blockdevice.py +++ b/src/cryptobox/core/blockdevice.py @@ -46,8 +46,10 @@ LOGGER = logging.getLogger("CryptoNAS") DEFAULT_SYSBLOCK_DIR = '/sys/block' DEFAULT_DEVNODE_DIR = '/dev' MINIMUM_STORAGE_SIZE = 10 +# defined device numbers: http://www.lanana.org/docs/device-list/devices.txt MAJOR_DEVNUM_LOOP = 7 MAJOR_DEVNUM_FLOPPY = 2 +MAJOR_DEVNUM_RAMDISK = 1 MAJOR_DEVNUM_MD_RAID = 9 ## cache settings @@ -233,6 +235,9 @@ class Blockdevice: ## otherwise we would have a long timeout, while reading the devices if (self.major == MAJOR_DEVNUM_FLOPPY): return False + # we don't want to store data in ramdisks (e.g. /dev/ram0) + if (self.major == MAJOR_DEVNUM_RAMDISK): + return False except TypeError: return False return True