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

Re: [Nbd] local mounted readonly and exported read write



On Wed, Apr 11, 2012 at 08:40, Goswin von Brederlow <goswin-v-b@...186...> wrote:
> Salatiel Filho <salatiel.filho@...17...> writes:
>
>> Hi guys , i have a doubt.
>> If i have a device , let's say /dev/sdb2 which is mounted locally read
>> only, and this same device is exported using nbd , and mounted
>> readwrite by the client. If the client writes to the Filesystem , this
>> can lead to data corruption ? Or the local filesystem will just be
>> unable to see the changes until it is remounted ?
>>
>> []'s
>> Salatiel
>
> Results are undefined and your kernel may oops at any time.
>
> Why doesn't nbd-server get an EBUSY when trying to open /dev/sdb2 if it
> is mounted?
>
> MfG
>        Goswin


Did a little test:

Machine 1 mounted /dev/sda2 as /mnt read only
Machine 1 exported /dev/sda2 using nbd
Machine 2  uses nbd-client to connect to machine 1 and mount the
exported device as /media
Machine 2 creates a very big file in /media
Machine 1 sees that file after a while without needing remounting...

This is nice , though it can corrupt the fs some time.

[]'s
Salatiel



Reply to: