Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: gpart utility: Can't access USB Hard Drive

  1. #1
    Junior Member
    Join Date
    Sep 2005
    Posts
    7

    gpart utility: Can't access USB Hard Drive

    I have an external hard drive that plugs into my USB port. Knoppix assigns the device /dev/uba1 to it. When I try to scan the drive using the command "gpart /dev/uba1", I receive the message "*** Fatal error: ioctl(HDIO_GETGEO) failed: Inappropriate ioctl for device."

    I accidentally deleted the primary NTFS partition on this drive and I'm trying to re-create it. Can gpart help me with this? What do I need to do?

  2. #2
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441

    Re: gpart utility: Can't access USB Hard Drive

    Quote Originally Posted by ktas
    .... Knoppix assigns the device /dev/uba1 to it. When I try to scan the drive using the command "gpart /dev/uba1", I receive the message "*** Fatal error.....
    I havn't used gpart much and never on a usb device, but shouldn't you be scanning uba, the hard drive, and not uba1, the partition that does not exist?

  3. #3
    Junior Member
    Join Date
    Sep 2005
    Posts
    7
    Well, I'm new to this, but perhaps you're right. If that's all it is, I'll be embarassed, but appreciative! I'll try that.

  4. #4
    Senior Member registered user
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    376
    Quote Originally Posted by ktas
    Well, I'm new to this, but perhaps you're right. If that's all it is, I'll be embarassed, but appreciative! I'll try that.
    Yup. You want the device where the partition table is stored, i.e. /dev/uba. According to the man page, yes, gpart should be able to recover the partition table even if the filesystem is NTFS. I'm curious to know how you deleted the partition and how well gpart worked to recover it. So, please let us know how it goes.

    As safety net, you may want to image the entire device before you let gpart work on it. You can image the device with dd. How big is the USB device? Do you have enough space on another device to store the image?

    Regards,
    - Robert
    http://www.cwelug.org

  5. #5
    Junior Member
    Join Date
    Sep 2005
    Posts
    7
    Well, I did try using "/dev/uba" and received the same error msg. The error seems to be saying that the routine HDIO_GETGEO that the program is using is not valid for USB. The device is a 200 GB Maxtor external drive. But, at this point, I can't even perform a sucessful scan of the drive.

  6. #6
    Senior Member registered user
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    376
    Quote Originally Posted by ktas
    Well, I did try using "/dev/uba" and received the same error msg. The error seems to be saying that the routine HDIO_GETGEO that the program is using is not valid for USB. The device is a 200 GB Maxtor external drive. But, at this point, I can't even perform a sucessful scan of the drive.
    What is a "successful scan"? Are you able to read the first 512 bytes of the drive with dd? For example:
    Code:
    dd if=/dev/uba of=/tmp/mbr.img bs=512 count=1
    BTW, if you know the NTFS partition took up the entire drive you can simply "repartition" with fdisk. Again, you may want to make an image of the drive first.

    Regards,
    - Robert
    http://www.cwelug.org

  7. #7
    Junior Member
    Join Date
    Sep 2005
    Posts
    7
    Quote Originally Posted by rwcitek
    What is a "successful scan"? Are you able to read the first 512 bytes of the drive with dd? For example:
    Code:
    dd if=/dev/uba of=/tmp/mbr.img bs=512 count=1
    BTW, if you know the NTFS partition took up the entire drive you can simply "repartition" with fdisk. Again, you may want to make an image of the drive first.

    Regards,
    - Robert
    http://www.cwelug.org
    No, I was referring to the "gpart" utility which refuses even to scan the drive. I know there was only a single NTFS partition. Repartitioning with fdisk won't lose data?

  8. #8
    Senior Member registered user
    Join Date
    Feb 2005
    Location
    Saint Louis, MO, USA
    Posts
    376
    Quote Originally Posted by ktas
    No, I was referring to the "gpart" utility which refuses even to scan the drive. I know there was only a single NTFS partition. Repartitioning with fdisk won't lose data?
    Uh, you've got a backup image, right? In that case, no, you won't lose any data. Partitioning, especially when there's only one partition involved, only modifies the first 512 bytes of data. Destroying the partition table is kind of like ripping out the table of contents from a book. The chapters are still there, you just don't know how many there are or where they are or how big they are. But if you know there was only one partition and it took the entire drive and it was NTFS, then you can recreate the partition table.

    However, if you do not create a backup image first, yes, whatever you do will immediately destroy all hopes of getting any meaningful data off the drive. That rule is called "Murphy's Law" and it holds true whenever there's really important data involved.

    Regards,
    - Robert
    http://www.cwelug.org

  9. #9
    Junior Member
    Join Date
    Sep 2005
    Posts
    7
    Quote Originally Posted by rwcitek
    Quote Originally Posted by ktas
    No, I was referring to the "gpart" utility which refuses even to scan the drive. I know there was only a single NTFS partition. Repartitioning with fdisk won't lose data?
    Uh, you've got a backup image, right? In that case, no, you won't lose any data. Partitioning, especially when there's only one partition involved, only modifies the first 512 bytes of data. Destroying the partition table is kind of like ripping out the table of contents from a book. The chapters are still there, you just don't know how many there are or where they are or how big they are. But if you know there was only one partition and it took the entire drive and it was NTFS, then you can recreate the partition table.

    However, if you do not create a backup image first, yes, whatever you do will immediately destroy all hopes of getting any meaningful data off the drive. That rule is called "Murphy's Law" and it holds true whenever there's really important data involved.

    Regards,
    - Robert
    http://www.cwelug.org
    Okay. Thanks so much for the help.

  10. #10
    Senior Member
    Join Date
    Nov 2003
    Posts
    1,323
    You can also see if testdisk sees the partition, but like rwcitek said, the easiest way is to just fdisk a new partition AFTER taking a backup image of the disk.

Page 1 of 2 12 LastLast

Similar Threads

  1. How to access hard drive?
    By dealrocker in forum Laptops
    Replies: 2
    Last Post: 08-13-2010, 02:06 PM
  2. Access Linux hard drive
    By PMFAN in forum General Support
    Replies: 1
    Last Post: 05-10-2009, 12:45 AM
  3. Access hard drive?
    By martynball in forum Hardware & Booting
    Replies: 1
    Last Post: 12-22-2008, 04:36 PM
  4. Slow access to USB hard drive
    By rafaelorta in forum Hardware & Booting
    Replies: 3
    Last Post: 09-06-2005, 06:33 PM
  5. hard-drive access troubles
    By Colonel Sanders in forum Hardware & Booting
    Replies: 2
    Last Post: 08-21-2003, 04:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Dell SNPTP9W1C/16G 16 GB 2666MHz (PC4-2666) Memory Ram picture

Dell SNPTP9W1C/16G 16 GB 2666MHz (PC4-2666) Memory Ram

$34.95



Micron 8GB DDR4 1Rx16 PC4-3200AA Laptop RAM Memory MTA4ATF1G64HZ-3G2E2 picture

Micron 8GB DDR4 1Rx16 PC4-3200AA Laptop RAM Memory MTA4ATF1G64HZ-3G2E2

$10.00



A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$13.99



Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory picture

Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory

$54.99



Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3 picture

Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3

$22.45



[ BULK LOT OF 10 ] 8GB DDR4 Desktop RAM SAMSUNG, HYNIX etc. (10x) picture

[ BULK LOT OF 10 ] 8GB DDR4 Desktop RAM SAMSUNG, HYNIX etc. (10x)

$89.99



BULK LOT OF 10x UNITS of 8GB DDR3 Desktop RAM SAMSUNG, HYNIX etc. (10x) picture

BULK LOT OF 10x UNITS of 8GB DDR3 Desktop RAM SAMSUNG, HYNIX etc. (10x)

$59.99



HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin picture

HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin

$15.90



SK Hynix 64GB (4x16GB) DDR4 2666 MHz PC4-21300 DIMM RAM Kit - HMA82GU6JJR8N-VK picture

SK Hynix 64GB (4x16GB) DDR4 2666 MHz PC4-21300 DIMM RAM Kit - HMA82GU6JJR8N-VK

$89.99



Dell Memory SNPK7G24C/16G AB883074 16GB 1Rx8 DDR5 UDIMM 4800MHz RAM picture

Dell Memory SNPK7G24C/16G AB883074 16GB 1Rx8 DDR5 UDIMM 4800MHz RAM

$98.95