LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
LinkBack Search this Thread
Old 07-04-2009, 03:58 PM   #526
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Wheezy amd64, i386; Adrienne Knoppix, VMware, OpenSuSE, Fedora 14 x86_64
Posts: 1,439

Original Poster
Rep: Reputation: 95
Arrow Size limit


Quote:
Originally Posted by Completely Clueless View Post
Every once in while (and it isn't often) one comes across a genuinely valuable resource like this. The only criticism I would make is that it could benefit from a little smoothing out here and there as at the moment it resembles some tech-head's hastily scribbled notes. If this could be done without the document losing its pithy conciseness, it would be AWESOME indeed.

Despite the above, you write VERY informatively. How about a seperate, substantive article along similar lines on computer forensics? You obviously know what you're talking about!
I needed to watch the character count. 25,000 characters is the limit per post. If I smooth out the post with some transitions, I'll have to remove some existing content because of this size limitation.

There are many good resources currently available for computer forensics. I may consider writing another one, but that is a daunting prospect.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-04-2009, 04:46 PM   #527
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 9,000
Blog Entries: 1

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Hi,

Everyone wants something that is condensed. They don't want to dig to find the jewels. I like the post/thread as it is. One for the way queries leading to solutions plus the added facets which form a better cut.
 
Old 08-17-2009, 09:47 PM   #528
totaliger
LQ Newbie
 
Registered: Aug 2009
Posts: 1

Rep: Reputation: 0
Great post! Thanks for detailed descriptions.
 
Old 09-01-2009, 02:28 PM   #529
terryxela
Member
 
Registered: Dec 2006
Location: Denver, Colorado, USA
Distribution: SuSE 11.3
Posts: 125

Rep: Reputation: 17
MBR backup and restore

Q: are my assumptions about restore the MBR correct??

To backup the MBR and the tables to a floppy:

# dd if=/dev/sda of=/dev/fd0 bs=512 count=1

I have a sata system and sda is my first HD.

To Restore:

# dd if=/dev/fd0 of=/dev/sda bs=512 count=1

This will restore the bootloader with the partition table as indicated in this thread before.

# dd if=/dev/fd0 of=/dev/sda bs=446 count=1

Is this correct? The intention is to restore the bootloader without the partition table from a backup that includes the partition table.

Great thread!!

-=terry=-
 
Old 09-06-2009, 05:25 AM   #530
niksosf
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Rep: Reputation: 0
reversing dd if=boot1h of=/dev/rdisk2s

Hello, folks! I was trying to install Mac OSX; but en route there, I accidentally did the following to my lacie external hard drive with my pictures and data (was trying to boot from a USB stick):

sudo dd if=boot1h of=/dev/rdisk2s2

where rdisk2s2 was not what I intended; I intended rdisk3s1. Now that partition isn’t see on Windows nor Mac. On Windows, it prompts me to format it which I say no to each time. Is there anything that you think might work to get back this partition?

Thank You!
 
Old 09-13-2009, 07:56 AM   #531
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 229Reputation: 229Reputation: 229
-=terry=-,

You've got it right.

The only change I'd make to your post is to put the code in [code]
blocks. If you decide to do that, you can edit the original rather than repost.
 
Old 09-13-2009, 08:07 AM   #532
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 14,972

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
Quote:
Originally Posted by niksosf View Post
Hello, folks! I was trying to install Mac OSX; but en route there, I accidentally did the following to my lacie external hard drive with my pictures and data (was trying to boot from a USB stick):

sudo dd if=boot1h of=/dev/rdisk2s2

where rdisk2s2 was not what I intended; I intended rdisk3s1. Now that partition isn’t see on Windows nor Mac. On Windows, it prompts me to format it which I say no to each time. Is there anything that you think might work to get back this partition?

Thank You!
How large was this boot1h file?

If it is less than 32k, you may be able to reconstruct the partition table using Linux. I don't know if the equivalent can be done on a Mac. For Linux & Windows at least, the first partition probably starts on block 63.

First attach a loop device to the disk.
sudo /sbin/losetup -fs /dev/<devicenode> -o $((63*512))

It should respond with the loop device used. Let's say that is loop0.

Next look at the filesystem on the loop device:
sudo file -s /dev/loop0

If it indicates the filesystem, you know this is where the filesystem starts. Next determine the size of the filesystem. This can give us the size of the partition:
df -lu /dev/loop0

Now you can use fdisk to recreate the entries for the first partition.
 
Old 09-16-2009, 09:34 PM   #533
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Wheezy amd64, i386; Adrienne Knoppix, VMware, OpenSuSE, Fedora 14 x86_64
Posts: 1,439

Original Poster
Rep: Reputation: 95
Smile MBR correct technique

Quote:
Originally Posted by terryxela View Post
Q: are my assumptions about restore the MBR correct??

To backup the MBR and the tables to a floppy:

# dd if=/dev/sda of=/dev/fd0 bs=512 count=1

I have a sata system and sda is my first HD.

To Restore:

# dd if=/dev/fd0 of=/dev/sda bs=512 count=1

This will restore the bootloader with the partition table as indicated in this thread before.

# dd if=/dev/fd0 of=/dev/sda bs=446 count=1

Is this correct? The intention is to restore the bootloader without the partition table from a backup that includes the partition table.

Great thread!!

-=terry=-
Terry,
Bs=512 is the default for dd. If one is going to use bs=512 or bs=1b, the bs parameter may be omitted.

I'm not a stickler for details. Yes I am. But I'm not trying to get on your case or anything. The first 446 bytes of the the MBR is called the bootstrap code, not the bootloader code.

The bootloader is something different. I know the word bootloader can sometimes be seen in the MBR, but that's part of a message to be displayed in the case of no bootloader.

Other than that you're right on.

-Awesome
 
Old 09-16-2009, 10:11 PM   #534
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian Wheezy amd64, i386; Adrienne Knoppix, VMware, OpenSuSE, Fedora 14 x86_64
Posts: 1,439

Original Poster
Rep: Reputation: 95
Post Partition recovery

Quote:
Originally Posted by niksosf View Post
Hello, folks! I was trying to install Mac OSX; but en route there, I accidentally did the following to my lacie external hard drive with my pictures and data (was trying to boot from a USB stick):

sudo dd if=boot1h of=/dev/rdisk2s2

where rdisk2s2 was not what I intended; I intended rdisk3s1. Now that partition isn’t see on Windows nor Mac. On Windows, it prompts me to format it which I say no to each time. Is there anything that you think might work to get back this partition?

Thank You!
If the partition was visible to Windows and Mac before you messed with it, it's probably formatted as fat32. Depending on how large boot1h is, you essentially overwrote that much space.

It would help to know what boot1h is. Is it a boot sector image? Is it a partition image file? Is it a partition itself.

In any event, here's a page of partition recovery tools:

http://www.thefreecountry.com/utilit...recovery.shtml.
 
Old 09-17-2009, 07:29 AM   #535
terryxela
Member
 
Registered: Dec 2006
Location: Denver, Colorado, USA
Distribution: SuSE 11.3
Posts: 125

Rep: Reputation: 17
Quote:
Originally Posted by AwesomeMachine View Post

The bootloader is something different. I know the word bootloader can sometimes be seen in the MBR, but that's part of a message to be displayed in the case of no bootloader.

Other than that you're right on.

-Awesome
Thxs and Thxs!

-=terry=-
 
Old 09-17-2009, 07:40 AM   #536
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: SuSE 11.4_64-KDE, 12.1_64-KDE
Posts: 3,281

Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
Thanks for that one .
 
Old 09-23-2009, 02:29 PM   #537
niksosf
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Rep: Reputation: 0
Thanks Terry, I GOT IT to WORK!
 
Old 09-24-2009, 07:26 AM   #538
Duck2006
Member
 
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
Quote:
Originally Posted by AwesomeMachine View Post
If the partition was visible to Windows and Mac before you messed with it, it's probably formatted as fat32. Depending on how large boot1h is, you essentially overwrote that much space.

It would help to know what boot1h is. Is it a boot sector image? Is it a partition image file? Is it a partition itself.

In any event, here's a page of partition recovery tools:

http://www.thefreecountry.com/utilit...recovery.shtml.
Thanks for the recovery info helped a lot.
 
Old 10-02-2009, 05:20 AM   #539
helsinkipirate
LQ Newbie
 
Registered: Oct 2009
Posts: 1

Rep: Reputation: 0
the manual is great
 
Old 10-02-2009, 09:49 AM   #540
glh
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
Thanks for an article that shows just how useful and powerful a command can be.
 
  


Reply

Tags
backup, best, clonezilla, cloning, command, data, dd, disk, drive, duplicate, erase, explanation, formatting, ghost, hard, image, iso, memory, ping, popular, recover, recovery, rescue, search, security, stick, upgrade, usb, wipe


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Learn The DD command AwesomeMachine Linux - Newbie 17 08-17-2006 05:22 AM
The best way to learn? iz3r Programming 7 02-07-2005 12:00 AM
Best way to learn Linux from the command line patpawlowski Linux - General 2 03-01-2004 04:37 PM
I want to learn C. KptnKrill Programming 14 12-18-2003 02:03 PM
Best way to learn.... InEeDhElPlInUx Linux - Newbie 5 10-11-2003 02:02 AM


All times are GMT -5. The time now is 12:24 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration