LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 02-11-2012, 02:53 PM   #721
[rascas]
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled

Hi there!

Some days ago i did a dd image write of a Linux Mint image. The command i used was the recommended in their page: sudo dd if=~/Desktop/linuxmint.iso of=/dev/sdb oflag=direct bs=1048576
The problem was that i was sleeping and mistaken the drive letter and writed the image to an External USB 2TB hard drive instead of the usb pen drive! This was not so much a problem because i had a backup of that drive.

The real problem is, to put the data that i lost, again in that drive, i erased all partitions in gparted, created a new partition table, formated in NTFS (it has to be), then in windows did the same thing again just to be sure. Gparted, fdisk and windows disk management tool, all show me that the disk only has one partition (what i want). The problem is when i plug the drive into the PC, the Kde device notifier and Dolphin shows like 2 drives have been plugged ( One with the label "Store" with my files, and another with device name's label, with the files of the Mint image that i preveously writed). I can only mount one of that drives at a time.
Fdisk-l output:

Quote:
Disk /dev/sdb: 2000.4 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907024896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00061614

Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907020799 1953509376 7 HPFS/NTFS/exFAT
[diogo@ds-desktop ~]$
Well, something wrong is going here. I tried to google for a solution but didnt found anything. Hope someone can help me, specially if i can resolve this without reformatting the hard drive (it takes almost one day to put the data back)

Thanks in advance
 
1 members found this post helpful.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-13-2012, 07:48 AM   #722
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by [rascas] View Post
...The real problem is, to put the data that i lost, again in that drive, ... Gparted, fdisk and windows disk management tool, all show me that the disk only has one partition (what i want). ...
You lost me there somewhere. You re-created and formatted a NTFS partition as needed. Well, then restore the data and have a look whether your backup worked .

Quote:
Originally Posted by [rascas] View Post
...The problem is when i plug the drive into the PC, the Kde device notifier and Dolphin shows like 2 drives have been plugged ( One with the label "Store" with my files, and another with device name's label, with the files of the Mint image that i preveously writed).
On my box KDE shows (sometimes) the whole device and the partition.

Quote:
Originally Posted by [rascas] View Post
...I can only mount one of that drives at a time.
Definitely "unusual". Looks like you didn't format the whole device but created a new partition. Perhaps a dedicated thread in an appropriate forum here might bring better results, sorry.

Quote:
Originally Posted by [rascas] View Post
...
Fdisk-l output:
Code:
Disk /dev/sdb: 2000.4 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907024896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00061614

Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907020799 1953509376 7 HPFS/NTFS/exFAT
That's what I meant: The first block is the device /dev/sdb, the second the partition /dev/sdb1.
 
1 members found this post helpful.
Old 02-13-2012, 12:06 PM   #723
[rascas]
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled
Yeah my post seems a bit confusing. I will try to explain better.
Forget the data backup part. I did that already and its not the problem. I did that in windows ( i dont trust linux/fuse to copy/move data between ntfs partitions). They are to WD Caviar green 2 TB.

Now i have 2 virtually identically drives with the same data. Virtually because, now in linux (dolphin) it is showing me one of the disks having 2 partitions. My only issue is that only dolphin and the kde device manager shows me that. Gparted and fdisk tells me that there is only one partition in that disk. Windows "sees" only one partition to. Thats what is confusing me (and maybe you). See the picture:

http://img35.imageshack.us/img35/7858/dolphinuf.jpg

WDC WD20EARS and Store is the same hard drive. This is the drive that i made the image copy with dd by accident. But on fdisk:

Code:
Disk /dev/sdb: 2000.4 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907024896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00061614

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3907020799  1953509376    7  HPFS/NTFS/exFAT

Disk /dev/sdc: 2000.4 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907024896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002de0f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048  3907020799  1953509376    7  HPFS/NTFS/exFAT
[diogo@ds-desktop ~]$
Can you see? The same info for the 2 drives. sdb is the "Store" drive. sdc is the "Backup" drive. Confirmed in gparted.

But i can tell you something is wrong beacause if i try to boot the computer by the "Store" HD (selected it in BIOS) the computer seems to detect a bootloader and tries to boot it but it fails and hangs (have to do a reset). This doesnt happen with the "Backup" drive.
Its stupid because neither hard drives have the "boot flag".
I made a "chkdsk" to the "Store" HD in windows and all seems fine. No errors or bad sectors.

When i made the data backup im pretty sure that i deleted the partition table and all partitions, and created only one partition. All of this with gparted.

I think dd messed up this hard drive... Can you tell at least if there is any dd command that erases all data and all partitons (well, everything), like if it was new? So that i can start from scratch and make the backup again.

Thanks
 
1 members found this post helpful.
Old 02-14-2012, 02:14 AM   #724
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by [rascas] View Post
...Now i have 2 virtually identically drives with the same data. Virtually because, now in linux (dolphin) it is showing me one of the disks having 2 partitions. My only issue is that only dolphin and the kde device manager shows me that. Gparted and fdisk tells me that there is only one partition in that disk. Windows "sees" only one partition to....
I think this is a misconception on your part (no slight intended). As hinted in my previous post, KDE shows you the device ("WDC..." aka /dev/sdb) and the partition ("store" aka /dev/sdb1). I don't understand why it isn't doing this for the other drive as well.

Several things.

First, select the left menu (Places) and try pressing <F5>. This will re-read / refresh the data.

If this doesn't work, try the other mode(s) of dolphin. There is not only "Places" but several more choices to be made from "view" (I think. My dolphin looks quite different, there I chose from an icon on the right side...). Play around with dolphin, from your screenshot one can see, that you are using only the barebone abilities of it.

And thirdly, are you booting from "Backup"? If not, umount it and unplug it, then plug it in again. Let's see what then happens.

Quote:
Originally Posted by [rascas] View Post
...But i can tell you something is wrong beacause if i try to boot the computer by the "Store" HD (selected it in BIOS) the computer seems to detect a bootloader and tries to boot it but it fails and hangs (have to do a reset). This doesnt happen with the "Backup" drive.
Its stupid because neither hard drives have the "boot flag".
I made a "chkdsk" to the "Store" HD in windows and all seems fine. No errors or bad sectors.
Well, you dd-ed something over to the MBR of that drive. Your 'puter will try to act on that but an .iso is not organized like a hard disk. This is not dangerous as far as I can tell. Backup has obviously a "clean" MBR, so nothing happens. Linux / GRUB doesn't care for the boot flag, you can boot from anywhere.

Quote:
Originally Posted by [rascas] View Post
...I think dd messed up this hard drive... Can you tell at least if there is any dd command that erases all data and all partitons (well, everything), like if it was new? So that i can start from scratch and make the backup again.
Umm, you issued that command . And yes, there is a command to zero out your drive:
Code:
dd if=/dev/zero of=/dev/sdb bs=1M
Please make really, really sure it is sdb you are wanting to flatten, because everything will be gone irrevocably.

If you just want the MBR cleaned use:
Code:
dd if=/dev/zero of=/dev/sdb bs=512B count=1
You have then to re-partition and format it.
 
1 members found this post helpful.
Old 02-14-2012, 04:16 AM   #725
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Thanks a lot for this helpful thread. It's really helpful.. Hats off!
 
1 members found this post helpful.
Old 02-14-2012, 01:25 PM   #726
[rascas]
LQ Newbie
 
Registered: Feb 2012
Posts: 3

Rep: Reputation: Disabled
Hi JZL240I-U.
Thank you very much!! Cleaning the MBR with the dd comand you posted did the trick!
I didnt thought too much about the dd command i issued and i was not remembering an .iso is not organized like a hard disk. Thanks for remembering me that!!!
Now dolphin shows me only the partition and not the device name, the normal way, the way i wanted it.
I know how to use dolphin. I just like to get it simple . If i want something with more options i generaly use konqueror.

Anyway, thank you very much for your help and time.

Regards
 
1 members found this post helpful.
Old 02-14-2012, 03:01 PM   #727
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I don't understand why this thread hasn't been made a sticky,so that it's easily found by others. I myself have it bookmarked as there is a lot of information on a continuous basis.
 
1 members found this post helpful.
Old 02-24-2012, 01:52 PM   #728
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Post Not Stickied

Quote:
Originally Posted by EDDY1 View Post
I don't understand why this thread hasn't been made a sticky,so that it's easily found by others. I myself have it bookmarked as there is a lot of information on a continuous basis.
The dd post is good, but it really doesn't fit as a sticky, because it's not information nearly every newbie should know before embarking on the forum. But I don't make any decisions. That's my opinion.
 
1 members found this post helpful.
Old 02-24-2012, 01:56 PM   #729
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Just a quick note regarding some posts above: If you image to both an internal drive and a USB drive, the USB drive will probably not boot correctly, because the device files are slightly different. But GRUB2 usually will work if the USB image is the entire drive.
 
Old 02-25-2012, 09:24 AM   #730
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,922
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Member response

Hi,
Quote:
Originally Posted by AwesomeMachine View Post
The dd post is good, but it really doesn't fit as a sticky, because it's not information nearly every newbie should know before embarking on the forum. But I don't make any decisions. That's my opinion.
I agree that Learn the DD command should NOT be a sticky. Very useful and informative thread that does elevate within the forum.

Slackware®-Links references this thread: Learn the DD command.

I think the thread could be used to create/generate a <Linux-Answer> topic.
 
1 members found this post helpful.
Old 03-20-2012, 08:00 PM   #731
Master_CAPS
Member
 
Registered: Mar 2012
Location: I live at ::1 usually...
Distribution: Yes.
Posts: 55

Rep: Reputation: Disabled
LOL its called truecrypt... try that instead of this "book" on how to do this...
 
1 members found this post helpful.
Old 03-20-2012, 08:27 PM   #732
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by Master_CAPS View Post
LOL its called truecrypt... try that instead of this "book" on how to do this...
Posted in the wrong thread, maybe? dd has nothing at all to do with Truecrypt.
 
1 members found this post helpful.
Old 04-03-2012, 09:08 AM   #733
RagonichaFulva
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
Hello,

I would much appreciate your assistance.

I backuped mi /dev/sda5 partition with the following command:

Code:
sudo dd if=/dev/sda5 > /media/discoduroexterno/imagenes/partitionimage.dd
I obtained a .dd file (47 GBytes).

I tried to restore the partition (after repartitioning the disk) and with the command:

Code:
sudo dd if=/media/Maxtor/partitionimage.dd of=/dev/sda5
But the restored partition appears as if it had no format.

Now I am trying to mount the .dd file with the following command:

Code:
sudo mount -o loop -t auto /media/Maxtor/imagenes/partitionimage.dd /media/carpeta
but I obtain the following error:

Code:
mount: tipo fs incorrecto, opción incorrecta, superbloque incorrecto en /dev/loop0,
       falta página de código o programa ayudante, u otro error
       En algunos casos se encuentra información en syslog, pruebe
   dmesg | tail   o algo parecido
If I execute dmesg | tail this is the output:

Code:
0.337:29): apparmor="STATUS" operation="profile_replace" name="/usr/bin/evince//launchpad_integration" pid=2554 comm="apparmor_parser"
[  137.716848] type=1400 audit(1333351970.341:30): apparmor="STATUS" operation="profile_replace" name="/usr/bin/evince//sanitized_helper" pid=2554 comm="apparmor_parser"
[  137.718630] type=1400 audit(1333351970.341:31): apparmor="STATUS" operation="profile_replace" name="/usr/bin/evince-previewer" pid=2554 comm="apparmor_parser"
[  137.723892] type=1400 audit(1333351970.345:32): apparmor="STATUS" operation="profile_replace" name="/usr/bin/evince-previewer//launchpad_integration" pid=2554 comm="apparmor_parser"
[  137.725525] type=1400 audit(1333351970.349:33): apparmor="STATUS" operation="profile_replace" name="/usr/bin/evince-previewer//sanitized_helper" pid=2554 comm="apparmor_parser"
[  138.048707] init: plymouth-stop pre-start process (2664) terminated with status 1
[  648.843419] EXT4-fs (loop0): bad geometry: block count 69594112 exceeds size of device (11676287 blocks)
[ 1109.826664] EXT4-fs (loop0): bad geometry: block count 69594112 exceeds size of device (11676287 blocks)
[ 1204.990716] EXT3-fs (loop0): error: couldn't mount because of unsupported optional features (240)
[ 3981.553666] EXT3-fs (loop0): error: couldn't mount because of unsupported optional features (240)
It seems that the block count is giving me some problems.

Now I am using testdisk on the .dd file in order to correct any wrong value, but there is no geometry correction related to blocks.

So I am stuck here. At present I am analyzing the .dd with testdisk.

Any help would be much appreciated.

Thank you.
 
1 members found this post helpful.
Old 04-11-2012, 07:45 AM   #734
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by RagonichaFulva View Post
...
I backuped mi /dev/sda5 partition with the following command:

Code:
sudo dd if=/dev/sda5 > /media/discoduroexterno/imagenes/partitionimage.dd
...
That could be the source of your troubles if you really did that and not use "of=", like you did several lines below. If I understand the working of dd correctly, you redirected the standard output to a file. The standard output shows only printed characters and not the full range of hexadecimal values, so you lost lots of information (and in essence stored garbage). Anything of my assumption the more savvy readers would like to correct?

Last edited by JZL240I-U; 04-11-2012 at 07:46 AM.
 
2 members found this post helpful.
Old 04-11-2012, 08:40 AM   #735
RagonichaFulva
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
Surely the ">" symbol might be the problem. I could extract the files with photorec, but it's 47 GBytes of unordered files...
 
  


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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:31 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration