[Nbd] determining next free nbd device
- To: nbd-general@lists.sourceforge.net
- Subject: [Nbd] determining next free nbd device
- From: Raphael Bauduin <rblists@...17...>
- Date: Tue, 1 Oct 2013 15:27:01 +0200
- Message-id: <CAONrwUFBRk2qLXF7qYmqsQ8x6Oa95Qc4yUgNTxOWZcaLzv0-TA@...18...>
Hi,
How can I determine which is the first free nbd device?
Currently I have 2 ways to check if an device is connected: the first
is calling file on the device and check if it is empty or not. The
second is call lsblk and see if the device is in the list.
Rather than looping over all nbd devices until I find one free to use, I wondered if there's a way to immediately get the first free nbd device.
thanks
raph
Reply to: