With the rapid development of cloud computing, there are many storage structures have been proposed for satisfying cloud-based softwares requirements. Most existing distributed storage systems focus on a certain objective and only provide a certain storage structure. In this paper we present a novel block-level distributed storage system named Flex which integrates storage resource dispersed on the network into a whole one. Flex uses a device mapping framework to create dynamic and flexible storage structures for users. We have implemented the prototype and evaluated its performance; results show that Flex can provide a high performance in diverse storage structures.