Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a device that I can see in the output of fdisk -l:

/dev/dm-XX

(XX is a number.)

How do I know that I can use this /dev/dm-XX to add it to a RAID1 array? How can I be 100% sure that nothing is using this /dev/dm-XX?

share|improve this question
    
This is indeed a field in which Linux / LVM2 can improve. It requires a bit of puzzling. –  jippie May 27 '12 at 16:28

1 Answer 1

up vote 1 down vote accepted
sudo fuser /dev/dm-31
/dev/dm-31:          24799
ps -fp 24799
vbox     24799     1  2 May18 ?        04:37:39 /usr/lib/virtualbox/VBoxHeadle.....

or when using LVM2 (on Ubuntu, SLES may vary in detail):

ls -l /dev/mapper | grep dm-1$
lrwxrwxrwx 1 root root       7 May 11 19:01 vg_diablo-var -> ../dm-1

You may also want to check man dmsetup eg. dmsetup info

share|improve this answer
    
dmsetup info is the command to use - mainly the information about Open count. DM target can be opened/used for example by making a LVM volume group active, or by mounting a filesystem on LVM logical volume. –  Marki555 May 27 '12 at 18:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.