SCST iSCSI SANs again. It's been a few years since I've had a chance to configure one of these from scratch, and a lot has changed since 2012 when I first started using these.
In the past I've always used dd to create LUN files for use with SCST. For thin provisioned LUNs I would run something like the following:
sudo dd if=/dev/zero of=lun1 bs=1 count=0 seek=1TFor thick provisioned LUNs I would run this instead:
sudo sudo dd if=/dev/zero of=lun1 bs=1024 count=1T seek=1TWell, I found two utilities that do the same thing, but they are way faster and the syntax is way easier! One is called fallocate and the other is called truncate!
To create a thick provisioned LUN, you would use fallocate to create your file by running:
sudo fallocate -l 1T lun1To create a thin provisioned LUN, you would use truncate to create your file by running:
truncate -s 1T lun1So simple right? Why am I just learning about this now!?