Re: How to get the size of the loop-device?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/1/06, Markus Laire <malaire@xxxxxxxxx> wrote:
> Once I have a working loop device, e.g. /dev/loop5, how can I get the
> size of this device in bytes for bash-script?
> I need this, so that I can create two loop-devices on top on it, like
>   losetup -o 0 -s $halfsize /dev/loop6 /dev/loop5
>   losetup -o $halfsize /dev/loop7 /dev/loop5
>
> I tried trivial `perl -e 'print -s "/dev/loop5"'`, but it just returns zero.
>
> There's likely a trivial answer to this, but I havn't been able to find it.

ok, I just found one way to do it. I should have tried a bit more
before asking from the list.

`sudo perl -e 'open D, "<", "/dev/loop5"; print sysseek D,0,2; close D'`

--
Markus Laire

-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/



[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux