fdisk a drive that has been completely written over including mbr
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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 think the OP has tried - it used to be fdisk was pretty dumb and would work fine after zapping the disk. Now it does a lot more checks - some of which may get in the way.
Maybe try a parted script to write a partition table.
Ah. I think this happens because fdisk believes the disk has real data rather than random data.
Try "dd if=/dev/zero of=/dev/<whatever the disk is> bs=1M count=1". This should zero the first 1 MB of the disk (where the partition table would be, as well as any data in the first partition).
I had this problem after a hardware raid initialised some disks for itself. When I tried to use the disk without the controller fdisk wouldn't process the disk. Zeroing the beginning of the disk allowed things to work.
What do you mean by won't recognize the disk? Have you tried gparted on it? You should be able to use it to add a new partition table and filesystem to the drive.
One device is an external drive connected via USB to laptop, the other a USB stick. If I do lsusb neither is found. Gparted doesn't show up anything other than the laptop hard drive. After doing overwriting I rebooted using a clean Linux Mint 17.2 disk before partitioning either external drive or USB stick. I've managed in the past to partition or load a filesystem onto USB stick and drive but have forgotten how I did it.
If I do lsusb neither is found. Gparted doesn't show up anything other than the laptop hard drive.
afaiu, your problem is to find the drive, so that you can perform the dd thing described in post #4 (which i can confirm has helped me, too, in similar cases).
several ways:
- type "dmesg" in a terminal. have a good look at the last lines.
- plug in the drive. wait a minute.
- type "dmesg" again. look at the new lines. chances are it will tell you something about a new device, and where it resides (most probably /dev/sdXX).
Thank you everyone for your help,and my delay in replying to last post here. This is so embarrassing. I tried dmesg with and without the cable plugged in. Same message each time. I then tried to use a different cable with the external hard drive but the manufacturer in their wisdom made the drive plug so it only fits their cable. So I reinserted their cable and the device lit up and was found! I haven't had any issues in the past like this. First time I used dd on this drive so thought it was that. Now I have an external Backup drive, such a relief. Once again thank you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.