How can I view and fsck an external drive?

Discussions about using Linux guests in VirtualBox.
Post Reply
cainester
Posts: 6
Joined: 23. Jul 2017, 13:30

How can I view and fsck an external drive?

Post 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!
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: How can I view and fsck an external drive?

Post by socratis »

So are you looking for VirtualBox advice or for Ubuntu advice? If the first, what's the VirtualBox question?
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.
cainester
Posts: 6
Joined: 23. Jul 2017, 13:30

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

Post 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.
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: How can I view and fsck an external drive?

Post 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.
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.
cainester
Posts: 6
Joined: 23. Jul 2017, 13:30

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

Post 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?
Last edited by cainester on 23. Jul 2017, 14:36, edited 1 time in total.
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: How can I view and fsck an external drive?

Post by socratis »

Sure, I don't see why not...
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.
cainester
Posts: 6
Joined: 23. Jul 2017, 13:30

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

Post 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 3032 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)
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: How can I view and fsck an external drive?

Post 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.
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.
cainester
Posts: 6
Joined: 23. Jul 2017, 13:30

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

Post 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 3030 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 3030 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.
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: How can I view and fsck an external drive?

Post 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...
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.
cainester
Posts: 6
Joined: 23. Jul 2017, 13:30

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

Post by cainester »

OK. Thanks.
Post Reply