Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
So i plug in my thumb drive with nothing too important on it you know, just some finals that could mean the difference between a good grade or not, and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie dalinux_n00bie's Avatar
    Join Date
    Nov 2006
    Posts
    226

    USB Unformatted when it was fine not 2 hours ago


    So i plug in my thumb drive with nothing too important on it you know, just some finals that could mean the difference between a good grade or not, and i get a pop-up in windows that says "this drive is unformatted, do you wanna format it?" This scares me a lot. So i boot into linux and in "df -h", all it shows is "/dev/sdb", with no partitions on it.

    I did some research, found this program called TestDisk. I ran the test and I got a "partition sector doesn't have the endmark 0xaa55" error.

    Doing some more research, finding out that 0xaa55 is the last part of the boot sector, I told it to write to the MBR... the default....

    How do i make it so that I can get my files? What causes this so i can avoid it?
    "Do or do not...there is no try" -Yoda
    History is a set of lies agreed upon by the winners.
    Linux is user friendly, not idiot friendly.
    Linux User 437442

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    You can back up the MBR and restore it when you want
    to back it up
    # dd if=/dev/sdX of=/home/foo/sda-mbr.bin bs=512 count=1
    change X with applicable character.
    change /home/foo with your home folder path
    to restore it
    # dd if=/home/foo/sda-mbr.bin of=/dev/sdX bs=1 count=64 skip=446 seek=446
    EDIT:
    Oh yeah, Its really hard to get the data back as you dont have the back up of your partition table.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  3. #3
    Linux Newbie dalinux_n00bie's Avatar
    Join Date
    Nov 2006
    Posts
    226
    Quote Originally Posted by b2bwild View Post
    EDIT:
    Oh yeah, Its really hard to get the data back as you dont have the back up of your partition table.
    So because i did the default "test write" of my MBR, and i don't have a backup of my partition table, i'm screwed...
    "Do or do not...there is no try" -Yoda
    History is a set of lies agreed upon by the winners.
    Linux is user friendly, not idiot friendly.
    Linux User 437442

  4. #4
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    I suggest you backup the entire drive contents if you can ... that way you can restore it back to current state if needed. You can do this with dd but be careful about the order or you will wipe the drive !
    What does
    Code:
    fdisk -l
    report? are partitions recognised?

  5. #5
    Linux Newbie dalinux_n00bie's Avatar
    Join Date
    Nov 2006
    Posts
    226
    No it did not recognise any partitions. Both in fdisk and TestDisk.
    "Do or do not...there is no try" -Yoda
    History is a set of lies agreed upon by the winners.
    Linux is user friendly, not idiot friendly.
    Linux User 437442

  6. #6
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    Can you post output of
    Code:
    fdisk -l

  7. #7
    Linux Newbie dalinux_n00bie's Avatar
    Join Date
    Nov 2006
    Posts
    226
    Quote Originally Posted by Jonathan183 View Post
    Can you post output of
    Code:
    fdisk -l

    Code:
    Partition table entries are not in disk order
    
    Disk /dev/sdb: 8019 MB, 8019509248 bytes
    247 heads, 62 sectors/track, 1022 cylinders
    Units = cylinders of 15314 * 512 = 7840768 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb4               1        2192    16777216    0  Empty
    Partition 4 has different physical/logical beginnings (non-Linux?):
         phys=(0, 0, 0) logical=(0, 0, 1)
    Partition 4 has different physical/logical endings:
         phys=(0, 0, 0) logical=(2191, 23, 32)
    Partition 4 does not end on cylinder boundary.
    
    Disk /dev/sdb4: 17.1 GB, 17179869184 bytes
    247 heads, 62 sectors/track, 2191 cylinders
    Units = cylinders of 15314 * 512 = 7840768 bytes
    Disk identifier: 0x00000000
    
         Device Boot      Start         End      Blocks   Id  System
    /dev/sdb4p4               1        2192    16777216    0  Empty
    Partition 4 does not end on cylinder boundary.
    sorry for not doing this before. I was in windowz and had to boot into linux, and all the windows tools and some open source tools i found said there was no partition on it. BTW: this is a 8 gb flash drive, not a 17.1?
    "Do or do not...there is no try" -Yoda
    History is a set of lies agreed upon by the winners.
    Linux is user friendly, not idiot friendly.
    Linux User 437442

  8. #8
    Linux Newbie dalinux_n00bie's Avatar
    Join Date
    Nov 2006
    Posts
    226
    I also realized that this is in the network thread.... I could have sworn that i posted this in the Peripherals thread.....
    "Do or do not...there is no try" -Yoda
    History is a set of lies agreed upon by the winners.
    Linux is user friendly, not idiot friendly.
    Linux User 437442

  9. #9
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    My suggestion is after you have backed up the whole drive use dd to wipe the MBR and re-run testdisk.

    Code:
    dd if=/dev/zero of=/dev/sdb bs=512 count=1
    This should wipe the MBR including the partition table.

  10. #10
    Linux Newbie dalinux_n00bie's Avatar
    Join Date
    Nov 2006
    Posts
    226
    so how can i backup my drive if i can't access it?
    "Do or do not...there is no try" -Yoda
    History is a set of lies agreed upon by the winners.
    Linux is user friendly, not idiot friendly.
    Linux User 437442

Page 1 of 2 1 2 LastLast

Posting Permissions

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