0

i try insert USB memory and check the device is "/dev/sdb1"

root@ubuntu:~# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda 8:0 0 64G 0 disk

├─sda1 8:1 0 63G 0 part /

├─sda2 8:2 0 1K 0 part

└─sda5 8:5 0 1022M 0 part [SWAP]

sdb 8:16 1 3.8G 0 disk

└─sdb1 8:17 1 3.8G 0 part /media/fd74eeb0-2bf8-49b0-872a- 4a283f124c10

sr0 11:0 1 1024M 0 rom

sr1 11:1 1 1024M 0 rom

and create network device

nbd-server -r 2000 /dev/sdb

** (process:2778): WARNING **: Specifying an export on the command line is deprecated.

** (process:2778): WARNING **: Please use a configuration file instead.

and client side( same machine )

nbd-client 172.20.10.3 2000 /dev/nbd0

Negotiation: ..size = 3850MB

bs=1024, sz=4037017600 bytes

and mount nbd device

mount -o loop /dev/nbd0p1 point/

but mount as follows problem occurs

root@ubuntu# mount /dev/nbd0p1 point/

mount: block device /dev/nbd0p1 is write-protected, mounting read-only

when i tried modify files in device error occurrs

vi point/test.c

add lines

and :wq

point/test.c" E212: Can't open file for writing

why ??

i don't understand this

root@ubuntu:~# dmesg | tail

[ 371.280809] loop: Write error at byte offset 3035136, length 4096.

[ 371.280810] Buffer I/O error on device loop0, logical block 741

[ 371.280812] lost page write due to I/O error on loop0

[ 371.280815] loop: Write error at byte offset 4096, length 4096.

[ 371.280816] Buffer I/O error on device loop0, logical block 1

[ 371.280818] lost page write due to I/O error on loop0

[ 389.039901] loop: Write error at byte offset 8396800, length 4096.

[ 389.039909] EXT4-fs warning (device loop0): ext4_end_bio:317: I/O error -1 writing to inode 12 (offset 0 size 0 starting block 2050)

[ 389.039913] Buffer I/O error on device loop0, logical block 2050

[ 391.266099] hrtimer: interrupt took 8643276 ns

0

Solved.

my mistake

nbc-server "-r" option is read-only. ..

remove "-r" and mount -o loop correctly operates

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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