Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I recently used my 16Gb Verbatim STORE N GO pendrive to create an usb-install image of Arch. After looking at the wiki i tried for the first time to create an image with dd as described in there
Quote:
On GNU/Linux
Overwrite the USB drive
Warning: This will irrevocably destroy all data on /dev/sdx.
Note: Check with lsblk that the USB device is not mounted, and use /dev/sdx instead of /dev/sdx1. These are very common mistakes!
# dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx
After that i wanted to recover my pendrive but instead of following the wiki i did something stupid and formated the whole pendrive.
I restored a fully functional pendrive, but with only 400MB of capacity. So i reformated with Gparted and it gave me an error that i couldn't save in a .txt file as i was on a liveCD Ubuntu 10.04.
Next thing i tried is the wiki solution to recover the pendrive
Quote:
How to restore the USB drive
Because the ISO image is a hybrid which can either be burned to a disc or directly written to a USB drive, it doesn't include a standard partition table.
After you install Arch Linux and you're done with the USB drive, you should zero out its first 512 bytes (meaning the boot code from the MBR and the non-standard partition table) if you want to restore it to full capacity:
# dd count=1 bs=512 if=/dev/zero of=/dev/sdx
Then create a new partition table (e.g. "msdos") and filesystem (e.g. EXT4, FAT32) using gparted
The thing is that now whenever i try to format it with Gparted or with terminal comands i can't fix it, it drops me an error about
Quote:
Error in / out during read /dev/sdb
and i can't fix my pendrive.
I need help to retrieve my pendrive back.
usb pendrive = usb drive, it is a memory stick, not a flash card. Verbatim STORE N GO
Also this is what fdisk -l gives me:
Code:
$ sudo fdisk -l
[sudo] password for nicolas:
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Identificador del disco: 0x00076938
Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/sda1 * 63 385559 192748+ 83 Linux
Partition 1 does not start on physical sector boundary.
/dev/sda2 385560 10153079 4883760 82 Linux swap / Solaris
/dev/sda3 10153080 650150549 319998735 83 Linux
/dev/sda4 650150550 1953525167 651687309 83 Linux
Partition 4 does not start on physical sector boundary.
it's on spanish but the info is well known. Haven't used fdisk ever. I allways use graphical solutions for these problems as i'm not that experienced with sh.
Yes i did, before running fdisk. That's the problem, i don't even know what's happening to it, first i need to figure out what is going on with it, i know is not wroken because it's almost new and until this, it was working like a charm.
I will never ever use again dd command to create an OS image
hope i can bring it back...
What messages appear in /var/log/messages when you plug in the drive? Frankly, it sounds like the drive just decided to die. That wouldn't be due to any fault of dd -- that just happened to be what you were doing when the drive died.
i know is not wroken because it's almost new and until this, it was working like a charm.
New hardware is not a guarantee that it can't break and many electronic devices tend to break suddenly without any warnings.
Quote:
I will never ever use again dd command to create an OS image
I would consider that to be pure coincidence. I do things like that very often and never had a breakage that was caused by using dd. dd is doing nothing more than writing data to the device, there is no magical "break the device"-function.
Quote:
hope i can bring it back...
If not you can actually be happy that it was a new device and you still have warranty on it. Back to the vendor and get a new one.
New hardware is not a guarantee that it can't break and many electronic devices tend to break suddenly without any warnings.
...
I would consider that to be pure coincidence. I do things like that very often and never had a breakage that was caused by using dd. dd is doing nothing more than writing data to the device, there is no magical "break the device"-function.
...
If not you can actually be happy that it was a new device and you still have warranty on it. Back to the vendor and get a new one.
True, new hardware could have factory faults, not this one! i just fixed!
it wasn't a coincidence, i wroke the whole mbr table, using dd did not the trick, problem was that Arch is a dual iso with 32 and 64 bit iso inside the same boot image, so in order to recover the partition tables (because of some weird stuff arch does to pendrives) i had to follow exact same steps in that wiki, which i did not, because i thought that gparted was more suitable for me. WRONG!
I couldn't be happy if the device was new, as in my country is really hard to make validation of my warranty, since all the products are imported and most vendors will try every excuse they get in order to invalidate warranties.
@jefro:
lsusb showed me a Verbatim hard disk connected to BUS 001 (usb 2.0) so it's ok.
@rknichols:
I can't check /var/log/messages because...
Now at the interactive promt, you can check multiple options pressing 'm'.
Delete partition (press d), create a new partition (press n) - use the whole drive.
Write the changes (press w) and quit (press d).
Afterwards you should be able to use the whole drive again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.