A How-To ... Help - I dd'd to sda instead of sdb

Forum rules
Share your brain ;)
User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

A How-To ... Help - I dd'd to sda instead of sdb

Unread post by dkeg » Sun Aug 04, 2013 12:25 am

I'm posting to put it out there, and hopefully will maybe help someone else one day.

I did it today, it was bound to happen. After all, we do this so much. Anyway, its done and everything is gone. However, I do back up my configs and such, but did lose my wallpapers. I had a bunch of code too I lost, but I don't do that anymore, so I guess it doesn't really matter. Although I do think I have that on my external drive.

Anyway ...

I ran into other problems when attempting to resolve. I thought, easy peasy, boot fresh from an stick and start configurating. It was not that easy. It took me a few tries to finally realize that there seemed to be a sector that was not getting overwritten, even though I had completely restructured my HD. From ddg, I found
It appears that you somehow got an iso9660 filesystem header written into your hard disk's boot track. Since your first partition starts at sector 2048, and you are using the conventional msdos partition table, you can eliminate it by writing zeros to sectors 1-2047 with the following command:
And resolved with booting into a live cd and using chroot (with help of the fine work of the BBQ Cookbook

Then once I was in a root teminal on the system and before installing and updating grub

Code: Select all

sudo dd if=/dev/zero of=/dev/sda bs=512 seek=1 count=2047
Then I was free to successfully install and update grub. Finished up and rebooted. Success!

I am now finally back to basically where I left off. Well, minus a collection of a few years of choice walls ....

EDIT: fixed cookbook url
Last edited by dkeg on Sun Aug 04, 2013 1:58 am, edited 1 time in total.

Work hard; Complain less

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: A How-To ... Help - I dd'd to sda instead of sdb

Unread post by pidsley » Sun Aug 04, 2013 12:32 am

Ouch. But thanks for the guide.

(Moved topic to HowTo subforum)

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: A How-To ... Help - I dd'd to sda instead of sdb

Unread post by dkeg » Sun Aug 04, 2013 1:50 am

Thanks pids, yeah, i was teetering on where to post.

Work hard; Complain less

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: A How-To ... Help - I dd'd to sda instead of sdb

Unread post by pidsley » Sun Aug 04, 2013 1:59 am

dkeg wrote:Thanks pids, yeah, i was teetering on where to post.
I think the HowTo subforum is new -- I always used to post mine in the Support section, and bacon (I think) moved them to HowTo.

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: A How-To ... Help - I dd'd to sda instead of sdb

Unread post by wuxmedia » Sun Aug 04, 2013 9:45 am

yeah shit - thank goodness for backups.

Also this (apart from the chrooting bit) Fixes my USB flash drives after the length is 'set' by the dd'ing I then format them in windows as gparted refused to format as FAT32, although cfdisk works OK...

although the code is more

Code: Select all

 sudo dd bs=4M if=/dev/zero of=USBstick
"Seek, and Ye shall find"
"Github | Chooons | Site"

Post Reply