8

I have an external hard drive that Windows can't open (gives an error message saying the file system is unrecognized and wants me to reformat), so I am trying to see if Ubuntu, which I am running as a guest vm in VirtualBox on my Win 7 host, can open it.

I am confused as to how to mount it. When I open up VirtualBox and click "Settings" for the Ubuntu vm, do I go to "Storage" and try to see if I can mount it there, or do I go down to "USB" and attempt to mount it from there? When I tried the latter, and clicked on "Enable USB 2.0 (EHCI) Controller", a warning popped up from VB saying I needed to download VBox extensions to be able to select that option. So I downloaded the extensions and am unsure of what to do next. When I get into Ubuntu, how can I access the external hard drive via the command line? When I tried the command "fdisk -l", the following is printed:

http://paste.ubuntu.com/1053741/

But I have not done anything else in the VBox settings, so I don't think any of those hard drives listed are referring to the external USB drive that I want to access (even though the drive is plugged into my laptop). I do not know what drives sda1, sda2, and sda5 refer to exactly, but apparently I have an extended partition since it goes from sda1 and sda2 to sda5. When I created space for the Ubuntu virtual machine through VBox, I think I only created one main partition and one for the swap, so why is fdisk showing me 3 partitions, unless one of them is referring to the plugged in USB external hard drive, but I don't think that is it because I have not done anything else in the VBox settings for USB?

Any suggestions will be appreciated :-).


I have a Western Digital external HD of around 2TB; Windows 7 for some reason no longer allows me to open it: when I plug it into my laptop (via a USB 2.0 port), Windows either does nothing or asks me to format the drive because it doesn't recognize the file system. So I am trying to see if I can access the files in Ubuntu.

I am running Ubuntu through VirtualBox. Before starting Ubuntu, I went into the USB settings for the Ubuntu virtual machine, and selected the external hard drive (VBox sees it). Then I started Ubuntu. Here is the print out of fdisk -l:

Disk /dev/sda: 91.3 GB, 91268055040 bytes
255 heads, 63 sectors/track, 11096 cylinders, total 178257920 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d5f79

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   174583807    87290880   83  Linux
/dev/sda2       174585854   178255871     1835009    5  Extended
/dev/sda5       174585856   178255871     1835008   82  Linux swap / Solaris

Disk /dev/sdb: 2000.4 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907024896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00020fc3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048  3907024895  1953511424    7  HPFS/NTFS/exFAT

I believe the external drive is the bottom one, sdb1, but I have no idea how to access it. Is it already mounted or do I have to mount it manually? If Windows 7 did not recognize it, will the same problem occur in Ubuntu?

6
  • Might be easier to just boot a live CD/USB and mount the drive to see the files. You could copy them over to the Windows partition and then reformat the USB drive, if that's all you are wanting. Jun 22, 2012 at 6:10
  • Well, if Windows is saying that it doesn't recognize the file system now, won't that make it difficult to copy over files from the external HD to Windows? Also, there is over 1TB of data on the external, and my Windows hard drive in total is around 450GB.
    – Jay
    Jun 22, 2012 at 6:19
  • You can view all files on all partitions (assuming no encryption) with the Live CD, but that won't help due to the quantity of data you have vs. available space. For future reference, you can copy files to a Windows partition using a Live CD and then when you boot Windows, they are there ready to be accessed. Jun 22, 2012 at 6:26
  • Ok, thanks Tom; I will attempt to mount the USB to the VirtualBox and see if Linux recognizes it for now.
    – Jay
    Jun 22, 2012 at 21:03
  • Ok, so before I started up Ubuntu via VirtualBox, I went into the VBox settings and selected the external drive through the filter. Then, when I ran fdisk -l, sdb1 (which I'm pretty sure is the external hard drive) shows up. Since I am running Ubuntu via VBox on a Windows host, I am guessing that I do not need to make a vboxusers group, since the VBox manual lists this step for Linus hosts (newer ones), and does not list it for Windows hosts. My question now becomes how do I access the files in sdb1? When I tried "cd /dev/sdb1", it says "no such directory"; same for "sda1".
    – Jay
    Jun 23, 2012 at 5:18

2 Answers 2

9

those three partitions are all on the same drive.

the external hard drive should show up as /dev/sdb#.

go to Devices/USB Devices on the virtualbox window and select your external hard drive. now the drive should be mounted automatically by Ubuntu

1
  • I use Ubuntu guest (10.04) on Windows host (Vista) VirtualBox setup. I had the exact same query as OP and your solution worked perfectly well! Thank you! :-)
    – Amar
    Jul 7, 2015 at 13:32
0

Ubuntu can usually mount drives automatically and make it available in Nautilus, the file manager. Have you looked at the available drives with Nautilus?

To mount it yourself, you should create an empty directory someplace of your choosing; you can create it in your home directory to make it simple... From a commandline in the terminal, just type mkdir wd, for example.

Then try typing sudo mount /dev/sdb1 ~/wd and see what you get in the wd directory. This procedure should work, but is not ideal as it mounts all files with full read/write/execute privileges, but that can be refined if it works by setting it explicitly.

About the extended partition Windows seems to like to be installed in a primary partition, but Linux doesn't care. So a drive with both will usually have one primary partition, and one extended partition.

An extended partition has the advantage that it can contain any number of logical drives, whereas you are limited to only 4 primary partitions total. I believe the extended partition counts as one primary partition, so you can have 3 primary partitions plus one extended, if you wanted, but it's best to avoid primary partitions as much as possible; extended partitions are just more flexible.

5
  • Thanks Marty- it is asking me to specify a file system, which I don't know because I can't access it. All I know was that it was working fine in Windows 7 a few weeks ago, so it's probably NTFS or some kind of FAT. Any advice on what file system to choose? If I choose the wrong file system, will that damage the external drive?
    – Jay
    Jun 24, 2012 at 6:23
  • the type is exfat; I don't actually have anything with this type of file system. The full command is sudo mount -t exfat /dev/sdb1 ~/wd; but usually the type isn't required, so this might mean you don't have the exfat utilities as mentioned by Anwar Shah. The type tells it about the format for the raw data that is at /dev/sdb1. If you specify it wrong, it will look like garbage, and you wouldn't want to try to write to it. Jun 24, 2012 at 6:32
  • Ok I will try it with exfat. Btw, how did you know that that was the fs? Is exfat simply the standard fs for external hard drives by Western Digital and/or other disk drive manufacturers?
    – Jay
    Jun 24, 2012 at 8:22
  • Ok, so I tried the <code>sudo mount sudo mount -t exfat /dev/sdb1 ~/wd command and received the following message: "mount: unknown filesystem type 'exfat'"; any suggestions for this?
    – Jay
    Jun 26, 2012 at 5:10
  • @Jay: I might be confused - I'm not sure now why I thought it was exfat; maybe because I thought it would automatically detect NTFS, but it might be ntfs, so try "ntfs" (or "ntfs-3g") instead. I think I answered your original post, and now I'm not 100% sure my answer is even applicable without starting over, but try the mount with ntfs as the type to see what happens. Jun 26, 2012 at 5:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .