Page 1 of 1

How can I view and fsck an external drive?

Posted: 23. Jul 2017, 13:32
by cainester
I am running VB on macos...and I wanted to diagnose a ext4 external hdd
However once I got into Ubuntu I am completely lost

Any advice would be greatly appreciated!

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 14:12
by socratis
So are you looking for VirtualBox advice or for Ubuntu advice? If the first, what's the VirtualBox question?

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 14:28
by cainester
Well its a question about using Ubuntu within the Virtualbox environment, since there wouldn't be a problem if I was in native Ubuntu. It would recognize the external hdd automatically.

Since MacOS can't recognize the ext4 drive nor can it repair it, so I figured I would run VirtualBox to try and fix it in Ubuntu.

Hope it helps clarify the situation a bit.

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 14:30
by socratis
Not really. Is the external HD a USB one? In that case, you need to pass control of the USB device to the guest. Please read the following: USB basics and troubleshooting, all of the posts. If you still have a problem after reading through the whole thing, please follow the advice of the last post.

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 14:34
by cainester
Ok, thanks a lot :) Let me try and read up on the material.
Yes the hdd is connected via USB (the drive itself is a 3.5" but connected via an adapter).

Just while I have you on my post, would performing fsck on the disk pretty straight forward after I follow the procedures you linked?

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 14:36
by socratis
Sure, I don't see why not...

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 15:14
by cainester
Ok I suppose I should stick to this thread instead of starting a new one.

socratis, I have followed the procedures on your linked post and got the usb devices to show in the Ubuntu interface.

However, since the said device is a 3.5" HDD connected via a SATA-USB adapter, VirtualBox or Ubuntu doesn't seem to be recognizing it as a storage device.
Screen Shot 2017-07-23 at 9.02.37 PM.png
Screen Shot 2017-07-23 at 9.02.37 PM.png (33.42 KiB) Viewed 3099 times
How can I fix this?

VB version: 5.1.24 r117012 (Qt5.6.2)
Guest version: Ubuntu 16.04 LTS
Host version: MacOS 10.12.1 (16B2555)

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 15:21
by socratis
That's fine. That's actually your USB device, not the hard drive. I would suggest to go with a filter, but for USB disks, the transient menu solution could work as well. You will not see your "Hitachi/Toshiba/Western Digital" hard drive, you'll see the adapter. For example, here are four such devices that I have:
<DeviceFilter name="HD Case: Sweex 3.5 SATA"         active="false" vendorId="05e3" productId="0718" revision="0041" remote="0"/>
<DeviceFilter name="HD Case: LogiLink 2.5 SATA USB3" active="false" vendorId="174c" productId="5106" revision="0001" remote="0"/>
<DeviceFilter name="HD Case: LogiLink 2.5 SATA"      active="false" vendorId="1bcf" productId="0c31" revision="0132" remote="0"/>
<DeviceFilter name="HD Case: Logilink 2.5 IDE"       active="false" vendorId="058f" productId="6391" revision="0100" remote="0"/>
Notice how in the nave I have "HD Case" in all of them? That's because the hard drive that is attached behind that USB-2-SATA bridge can differ. VirtualBox doesn't know that. It can't. The only thing that sees is the device.

Ubuntu should definitely see the hard drive that's behind the bridge.

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 15:38
by cainester
Yes, I finally got it to work! :)
Screen Shot 2017-07-23 at 9.25.53 PM.png
Screen Shot 2017-07-23 at 9.25.53 PM.png (31.8 KiB) Viewed 3097 times
sdb is the external drive. As a first time Ubuntu and VirtualBox user I am pretty impressed with myself :D
Thanks again for your help!

Do you mind if I ask an off-topic question...
After this I tried to perform fsck on this drive and it said I do not have r/w access to the drive
Screen Shot 2017-07-23 at 9.26.46 PM.png
Screen Shot 2017-07-23 at 9.26.46 PM.png (29.78 KiB) Viewed 3097 times
How should I give myself the access to this drive? Or should I at all?

Actually the drive is a Synology NAS drive (a WD 6TB) and therefore the ext4, and it seems to have some problems while in the NAS (which is a whole other story). And I wanted to diagnose the drive.

I know this is not a VirtualBox question anymore, but appreciate if you can help. It would save me running around trying to find solutions, which I had been doing for the whole day already.

Thanks again.

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 15:45
by socratis
I'm not 100% sure, but I think that you need to unmount that drive and then sudo the command:
sudo umount /dev/sdb
sudo fsck /dev/sdb
But I could be wrong. Google is your friend...

Re: How can I view and fsck an external drive?

Posted: 23. Jul 2017, 15:56
by cainester
OK. Thanks.