external usb remounts as readonly

This is for discussing general topics about how to use VirtualBox.
Post Reply
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

external usb remounts as readonly

Post by xahare »

virtualbox 5.22
host os x 10.12.4
guest ubuntu 16.04 lts

current extenstion pack is installed, and guest has latest guest additions.

when mounting a usb disk in the guest, it works fine for awhile, but then switches to read-only. not sure if this should go under mac hosts, linux guest, or here.

will go through the troubleshooting and logging stuff, but wanted to get this out first in case someone already knows whats going on.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: external usb remounts as readonly

Post by socratis »

xahare wrote:virtualbox 5.22
You mean 5.1.22, right? ;)
xahare wrote:when mounting a usb disk in the guest, it works fine for awhile, but then switches to read-only
I've never heard that kind of behavior before and I can't imagine the slightest reason that VirtualBox would do something like that. VirtualBox doesn't know if the filesystem in the USB device is read-only or read-write. In fact, it doesn't even care if there is a filesystem at all. It cares about the hardware, not its contents.

I would check for something else in your guest. Check the dmesg logs and see if you can see anything related.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

Re: external usb remounts as readonly

Post by xahare »

yes, 5.1.22 :)

dmesg gave a lot of the first reset message, but this looks like the relevant part.

Code: Select all

[29524.572074] usb 2-1: reset SuperSpeed USB device number 3 using xhci_hcd
[29524.590828] sd 5:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[29524.590833] sd 5:0:0:0: [sdc] tag#0 CDB: Write(10) 2a 00 02 bf 60 f0 00 00 f0 00
[29524.590836] blk_update_request: I/O error, dev sdc, sector 46096624
[29524.590971] Buffer I/O error on dev dm-0, logical block 7372800, lost sync page write
[29524.591354] Buffer I/O error on dev dm-0, logical block 0, lost sync page write
[29524.591363] JBD2: Error -5 detected when updating journal superblock for dm-0-8.
[29524.591380] EXT4-fs (dm-0): Delayed block allocation failed for inode 2623101 at logical offset 0 with max blocks 10 with error 5
[29524.591381] EXT4-fs (dm-0): This should not happen!! Data will be lost

[29524.591385] EXT4-fs error (device dm-0) in ext4_writepages:2627: IO failure
[29524.591387] EXT4-fs (dm-0): previous I/O error to superblock detected
[29524.591422] EXT4-fs (dm-0): I/O error while writing superblock
[29524.591424] EXT4-fs error (device dm-0): ext4_journal_check_start:56: Detected aborted journal
[29524.591426] EXT4-fs (dm-0): Remounting filesystem read-only
[29524.703653] usb 2-1: reset SuperSpeed USB device number 3 using xhci_hcd
[29525.415287] usb 2-1: reset SuperSpeed USB device number 3 using xhci_hcd
[29525.551441] usb 2-1: reset SuperSpeed USB device number 3 using xhci_hcd
[29525.687820] usb 2-1: reset SuperSpeed USB device number 3 using xhci_hcd
[29525.827582] usb 2-1: reset SuperSpeed USB device number 3 using xhci_hcd
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: external usb remounts as readonly

Post by socratis »

OK, let's see. We have I/O error on a specific sector, buffer I/O errors, journaling errors, the filesystem giving up and re-mounting it read-only.

You have 4 parameters to consider; host, guest, VirtualBox, hardware. My money would be on the hardware side, hardware corruption on the disk itself. I mean this sounds like the sequence of events that would happen in that case. I cannot exclude the possibility that something in the VirtualBox side isn't bad, but I believe we would have heard a lot more cases like this.

You could try another guest, another disk, another VirtualBox. Did this start happening now?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

Re: external usb remounts as readonly

Post by xahare »

tried another disk, same issue.

tried both disks on bare hardware on another laptop. copied a 19gig folder to each. both worked fine. so its down host, guest, and virtualbox. host hasn't given me such problems before. it would be strange from macbook, but still possible. ill look at guest and virtualbox first and get back to this.
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

Re: external usb remounts as readonly

Post by xahare »

just tried the same thing, same os, same disk, same host, but in vmware fusion. worked as expected. checked for updates in the virtualbox version, only the login and passwd packages. pretty sure its virtualbox.

could it be related to https://www.virtualbox.org/manual/ch12. ... odic-flush ? is it possible to set the flush interval for external devices or globally?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: external usb remounts as readonly

Post by socratis »

Really nice finding! But, as you noticed, it doesn't apply to USB connections, only SATA and IDE ones. As far as we know. At this point I believe that you've covered your bases. I found a couple of interesting tickets:
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

Re: external usb remounts as readonly

Post by xahare »

just went back to 5.1.18, and it worked. nothing strange in dmesg or syslog. so now we have a time frame.

5.1.20 had a checksum for a different build than the one available, so i skipped it.

ill go back to 5.1.22 and try those, ticket 15901 looks like it could be relevant.

i did try going down to usb2, but then it wouldn't accept the device at all. forgot about that till now. should have mentioned it in the original post. also, need to report this.
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

Re: external usb remounts as readonly

Post by xahare »

this happens on a duplicity backup of about 9gigs of data onto a luks encrypted usb drive. was using rdiff-backup before but that got real slow after a while, now i wonder if any of the above issues had something to do with that. the slow down of rdiff-backup was sudden, but i dont remember when. went from a few min, to several hours. duplicity takes 1/2hr for a full backup.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: external usb remounts as readonly

Post by socratis »

xahare wrote:5.1.20 had a checksum for a different build than the one available, so i skipped it.
Wow, you're checking the checksum! Kudos!
Don't skip it. 5.1.20-114629. It was a last minute change and maybe they didn't update the checksum? I can see it here just fine: http://download.virtualbox.org/virtualb ... SHA256SUMS

Other that that, great detective work so far!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

Re: external usb remounts as readonly

Post by xahare »

I reported the 5.1.20-114629 mismatch. they fixed it 90min later.

The bug that caused device resets and the block device to remount is fixed in 5.1.23-115260

just reported the other usb bug https://www.virtualbox.org/ticket/16742 but that ones minor. seems others have figured out to just set their guest usb controller to usb3 and go on. i could see this affecting someone using older hardware with usb2 ports. but, my mac doesnt have any, so couldnt try it.

thanks for all your help!
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: external usb remounts as readonly

Post by socratis »

xahare wrote:The bug that caused device resets and the block device to remount is fixed in 5.1.23-115260
Really? That's nice, really nice! Hope everything is working for you now, including the rdiff-backup.

Thanks for the feedback and the detective work!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
xahare
Posts: 19
Joined: 26. Jul 2016, 02:48

Re: external usb remounts as readonly

Post by xahare »

rdiff-backup also returned to acceptable performance. last incremental took 42min
Post Reply