简体   繁体   中英

Is there a way to mount a dd based file as a disk for cstore pool

I was trying to deploy a openebs cstore-pool based dynamically provisioned storage class so that I could have 3 seperate disks on 3 different machines.

While doing this I realized that I do not have an external drive and for capacity management I have to use a separate disk for pooling.

I created a disk image with dd with the size of 4GB for trying the feature.

$ dd if=/dev/zero of=diskImage4 bs=1M count=4096

When I mounted it I saw that it is mounted as a loop device to loop0, as shown in the lsblk command output

loop0    8:0    0     8K  1 loop mountPoint

What I was trying to achieve was,

sda      8:16   0   23.5G  0 disk 
└─sda1   8:18   0   23.5G  0 part /
sdb      8:0    0   4.0G   0 disk 
└─sdb1   8:1    0   4.0G   0 part 

How can I mount the new created file "diskImage4" as a disk partition.

I saw some mount parameters and the losetup command but they were all finally used for mounting the image as a loop device.

Or if there is a way to use files as disks in cstore-pools I would love to learn that.

If there is no common or understandable way to achieve this, thanks anyways.

You havent created a partition table on the virtual disk.

Do the DD as above, then run the output of that through gparted or fdisk and creat a partition table

then do an losteup losetup -f diskImage4

then read the partitions partx -a /dev/loop0 (or whatever the loop device is created as

Then do a lsblk

loop0 and loop0p1 should be visible

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM