Check if disk is in use before partitioning?

14 views
Skip to first unread message

Dylan Martin

unread,
Aug 10, 2018, 7:38:58 PM8/10/18
to Ansible Project
I all.  

I've used parted and lvm (lvg & lvol) to set up machines, but I recently broke a system when I repartitioned a disk that was already in use. (Wooops!)

Does anyone have a good idea how to determine if a block device is already in use?  By "in use" I mean, mounted in some way.

Thanks!
-Dylan 

Jonathan Lozada De La Matta

unread,
Aug 10, 2018, 9:59:57 PM8/10/18
to ansible...@googlegroups.com
you can see what is mounted with ansible facts.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/30e12558-0ad3-4420-9749-035ce905d720%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Jonathan lozada de la matta

AUTOMATION CONSULTANT - AUTOMATION PRACTICE

Red Hat Consulting Services

jloz...@redhat.com   



 

Shawn Singh

unread,
Aug 11, 2018, 12:26:50 AM8/11/18
to Ansible Project
Might be environment/company specific, but in my company we make a partition on each disk so I usually only operate on a disk where the number of partitions is {}.
I've heard discussions of folks using the entire disk, but that isn't something we do, so isn't an issue/concern.

Sakthivel G

unread,
Aug 11, 2018, 12:33:50 AM8/11/18
to ansible...@googlegroups.com
You can use df - h Linux command to check mounted disks

--
Reply all
Reply to author
Forward
0 new messages