LinuxQuestions.org
Register a domain and help support LQ
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 10-11-2007, 05:05 AM   #391
jasee
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Rep: Reputation: 15

Quote:
Originally Posted by saikee View Post
Like I said the first sector dd copies from one hard disk to another has the partition table. If the boundary in the partition table is bigger than the physical hard disk then as an operating system yourself, what could you do?

An operating system has to guarantee the data integrity if it read/write a hard disk! So it plays safe and refuses to read it. That is the best policy.

You can also try to partition a Pata disk to 63 partition with a Linux having a kernel older than 2.6.20 and ask the current Linux to read it. The answer is the new Linux, supporting a Pata disk same as a Sata/SCSI/USB with a maximum of 15 partitions, simply treat the old disk a raw disk and unformatted because the new kernel does not know how to handle it. (some may still support the Pata 63 partitions in the interim period)
You are talking about the maximum number of partitions, that is a different matter I am talking about 48bit LBA addressing. I'm saying that there are examples in the real world where the operating system can think a partition ends but because it can't LBA correctly it writes to the wrong sector and corrupts the disk. In the M$ windows world, there are several factors which guarantee that Microsoft Windows will recognise and be able to acess large disks, if all of these are correctly set then a large hard disk can be fully written to without danger. There are often no symptoms until the operating system tries to write to a sector which doesn't exist! Fortunately, most ordinary users don't use anywhere near the capacities of the disks available nowadays. Not sure about Vista, I'm trying not to use it. However it is a known problem with Microsoft Windows. I simply don't know about Linux
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-11-2007, 07:09 AM   #392
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
jasee,

I am puzzled by your real world.

AFAIK dd doesn't give a toss to what filing system is nor if LBA is used or not. It just copies the binary bits in "1" and "0" from one device to another device in a disk cloning process. The operation is controlled by the input device. It starts with its first sector and terminates when the last sector has been reached. No less and no more.

When the very first sector is cloned in it between the 447th to 510th bytes are the 4 primary parition tables, each 16 bytes long. If more partitions are needed a user must give up one primary to convert it into an extended partition.

If the user has only one partition and uses up the entire disk for it then the end boundary of the partition would be at the last sector of the hard disk. This information is faithfully cloned into the target disk.

If the new target disk is smaller then physically its last cylinder/head/sector limit will be smaller than that indicated by the cloned partition. Therefore no operating system knows what would be the safe way of handling such a situation. Remember each byte is accounted for by the filing indexing system held at the begining of the partition with the boot sector thus the clone smaller disk efeectively has part of the filing system truncated.

If the target partition is larger then the whole source disk can be accommodated, copied and the excess hard disk space is just unallocated space. If the fully 4 partitions have been created the excess hard disk is "dead" and unusable untill the last primary partition (or a converted extended partition) is deleted or resized to absorb the extra space. The extra space by default must be linked to the last partition of the hard disk.

To any Windows system, the cloned disk when occupying the orginal source disk position has to boot successfully because there is nothing changed. The partition table is exactly as before and every bit and byte of the partition is an exact mirror image of the source. I am therefore puzzled by your real world that a Windows system can think a partition ends at a position other than that stated in a valid partition table?

In my "unreal" world I have not met a XP or Vista, for which I hold 7 and 2 licenses respectively, that cannot be cloned by dd if the basic rule of having a larger target disk is followed. Also in my disks every partition hold one operating system. Thus my cloned disks must boot all different systems as the original. In my experience I never have any other operaing system of Dos, Linux, BSD or Solaris failed to boot up in a cloned disk. It is possible that I live in an unreal world because everything can be simple but others prefer to make it complicated.
 
Old 10-11-2007, 08:54 AM   #393
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 3,957

Rep: Reputation: Disabled
Quote:
Originally Posted by jasee View Post
...I really can't see why it's really necessary to go to so much trouble. Nowadays there are simple graphic utilities for resizing and copying partitions. I'm mentioned them before gparted and gnome partition editor. These work exceedingly well with linux and windows formatted disks and partitions. Probably you've got one or both of these. Otherwise find a bootable iso of them. It is then child's play to copy resize any partitions (lvm (linux) and dynamic disks (windows) are the exception))...
In this case the partition table itself contains erroneous entries. Can gparted and gnome partition editor repair those on the fly without you calculating the appropriate values?

Quote:
Originally Posted by jasee View Post
...Just because it's linux doesn't mean you have always work at the terminal prompt, it doesn't make it better! We're not in the dark ages!


Quote:
Originally Posted by jasee View Post
...dd_rescue (most verstile with dd_rhelp) ... allows you to work with dd_rhelp a sort of logging and simple batch file which you can customise to make as many passes as you dare at a failing hard disk partition and recover a readable partition.
Thanks for mentioning dd_rhelp, I'll google for it, didn't know about it .

<edit> Hah! Found it and while bookmarking the site I saw my already existing bookmark of it ...

Last edited by JZL240I-U; 10-11-2007 at 09:01 AM.
 
Old 10-11-2007, 06:27 PM   #394
jasee
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Rep: Reputation: 15
Quote:
Originally Posted by saikee View Post
In my "unreal" world I have not met a XP or Vista, for which I hold 7 and 2 licenses respectively, that cannot be cloned by dd if the basic rule of having a larger target disk is followed. Also in my disks every partition hold one operating system. Thus my cloned disks must boot all different systems as the original. In my experience I never have any other operaing system of Dos, Linux, BSD or Solaris failed to boot up in a cloned disk. It is possible that I live in an unreal world because everything can be simple but others prefer to make it complicated.
Sorry, I wish it was as simple as you describe. Dd's method of operation is simple but nothing else is! I've got five pcs here running a variety of operating systems, primarily w2k, and xp but I've got red hat enterprise on a scsi raid running virtual machines of nt4 terminal server, w2kserver, W2003 and xp etc. (Its actually all running on a mirror and two raid5s). Virtual machines are the way forward I think. On one machine I dual boot between suze and xp, most machines dual boot or more, however, most machines have removable disks so I can run whatever I want. I've also got ghosted images of the basic operating systems I use. Of course I've got lots of isos of linux and of course pe's for particular use. I've got a terrabyte of disk space on a least two machines. All this is licenced software BTW.
The machine I'm posting from has twenty partitions not including an external scsi box which contains another four disks! Not simple at all I'm afraid.

I've encountered the problems I've described, as have others I know and it's well documented.It's not difficult to deal with them but believe me or not, they do exist.
 
Old 10-11-2007, 06:56 PM   #395
jasee
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Rep: Reputation: 15
Quote:
Originally Posted by jasee View Post
Nowadays there are simple graphic utilities for resizing and copying prwise find a bootable iso of them. It is then child's play to copy resize any partitions (lvm (linux) and dynamic disks (windows) are the exception)).
Quote:
Originally Posted by JZL240I-U View Post
In this case the partition table itself contains erroneous entries. Can gparted and gnome partition editor repair those on the fly without you calculating the appropriate values?
No, and I don't see how you can with a dynamic disk anyway (for instance). As this can contain a mirror or a raid or stripped set, spead over a number of partitions. I've only just heard about linuxes lvm which if is works in a similar way is also going to be impossible to use dd on.
But for the jobs most of the posters here seem to be using dd for: simple copying of partitions, gparted etc are a better choice with the advantage of resizing as well. Try one of them and see, you'll be suprised how easy it can be: even for a dyed in the wool linux groupie :-)
 
Old 10-12-2007, 02:08 AM   #396
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 3,957

Rep: Reputation: Disabled
Quote:
Originally Posted by jasee View Post
No, and I don't see how you can with a dynamic disk anyway (for instance). As this can contain a mirror or a raid or stripped set, spread over a number of partitions. I've only just heard about linux's lvm which if it works in a similar way is also going to be impossible to use dd on.
It does and it is impossible with dd as long as you don't clone the whole setup. No arguments here.

https://www.redhat.com/search/ui.jsp...estion_box=lvm

But note in particular the possibility to do lvm snapshots:

http://kbase.redhat.com/faq/FAQ_80_3640.shtm

Quote:
Originally Posted by jasee View Post
But for the jobs most of the posters here seem to be using dd for: simple copying of partitions, gparted etc are a better choice with the advantage of resizing as well. Try one of them and see, you'll be suprised how easy it can be: even for a dyed in the wool linux groupie :-)
Who, me? Groupie? I'm just a beginner, don't get confused by the number of my posts, they are mostly silly questions so I can learn .
 
Old 10-13-2007, 11:54 AM   #397
peterb
Member
 
Registered: Aug 2003
Location: Athens, Greece
Distribution: Mandriva, Fedora
Posts: 128

Rep: Reputation: 15
Hello Awesome,

In your text above you wrote:
Quote:
Therefore, partition tables are interchangable between modern drives.
As I have cloned a 20gb to an 80gb, are you saying therefore that if I clone the mbr from the 20 to the 80 that I can initialize a type 8e partition for the rest of the 80gb and then copy the 2nd partition image over to the 2nd partition of the 80gb.

I have a post at the newbie's for additional info.
http://www.linuxquestions.org/questi...advice-591485/

Peter

Last edited by peterb; 10-14-2007 at 03:40 AM.
 
Old 10-26-2007, 04:34 AM   #398
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,842

Original Poster
Rep: Reputation: 260Reputation: 260Reputation: 260
Yes

Quote:
Originally Posted by peterb View Post
Hello Awesome,

In your text above you wrote:


As I have cloned a 20gb to an 80gb, are you saying therefore that if I clone the mbr from the 20 to the 80 that I can initialize a type 8e partition for the rest of the 80gb and then copy the 2nd partition image over to the 2nd partition of the 80gb.

I have a post at the newbie's for additional info.
http://www.linuxquestions.org/questi...advice-591485/

Peter
There are 4 partition table entries. You use a partitioning program to partition and format. There are seperate lvm tools to turn partitions into logical volumes
 
Old 10-27-2007, 05:19 AM   #399
BT+1
LQ Newbie
 
Registered: Aug 2007
Posts: 11

Rep: Reputation: 0
On copying encrypted partitions

Not that there's much useful to report, but I was asked to bring back any relevant experience a while ago...

g4u did OK copying the TrueCrypt partition originally, but choked when I tried to copy it just now to a disk containing a couple of dozen partitions (we use it for general backup). It couldn't get to the partition I wanted to use for the target (seemed to run out of steam at the letter 'p' - and I thought *Windows* drive letters were a restrictive crock...).

gparted in Ubuntu refused to copy the partition at all (presumably because it didn't recognize its internal format - not that there's any excuse for refusing to copy it bit-by-bit under those circumstances, as g4u does when it's working).

So I downloaded the gparted/clonezilla live CD as someone suggested earlier. The gparted system panicked while booting (no problems booting Ubuntu on the same hardware). Clonezilla booted and got through its source and destination partition menus but then got upset that the linked list of logical partitions on the destination drive was not in ascending partition position (not that there's any requirement that it should be, and neither Partition Magic nor gparted in Ubuntu had any problem with it) - and apparently decided that the appropriate solution was to clone the entire source disk (destroying the other existing partitions on the destination disk); at least it had the courtesy to ask me whether I really wanted to do that (needless to say, I didn't).

Guess I'll give dd a try after all, but I want to be damn sure that I give it the appropriate partition identifiers (that's one of the advantages to using a GUI utility that lets you point&click on an item that actually tells you what it is while you're selecting it) - especially since the clonezilla experience raised the interesting possibility that the identifiers might be assigned in different orders (physical position on disk vs. position in the linked list) by different functions...
 
Old 11-02-2007, 12:39 AM   #400
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,842

Original Poster
Rep: Reputation: 260Reputation: 260Reputation: 260
BT,

Use fdisk to list the partitions, or cfdisk. You can get a basic idea of which device to specify as the partition you want.
 
Old 11-02-2007, 02:32 AM   #401
henry pitax
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Rep: Reputation: 0
Talking great info

since i'm still a newbie this kind of thing is out of my league
but honestly it's awesome

thanks for the very detailed lesson


regards

neeeeeeeeewbie
 
Old 11-02-2007, 11:38 PM   #402
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,842

Original Poster
Rep: Reputation: 260Reputation: 260Reputation: 260
Smile You're not a Newbie. This is a newbie.

Quote:
Originally Posted by henry pitax View Post
since i'm still a newbie this kind of thing is out of my league
but honestly it's awesome

thanks for the very detailed lesson


regards

neeeeeeeeewbie
This newbie I knew had dial-up internet, MS Windows 95 (In 2003), a 1.2 Gb HDD, 32 MB ram, in a PC he got from a friend, who said itwas still a really good machine. When he clicked the mouse, he would first move the cursor to the right spot, let go of the mouse, and click the button with a pencil eraser tip. One time I asked him to look at his monitor, and he asked, "Is that the big bright thing?". "Yup!", i replied.

I was setting him up with yahoo.com mail, over the phone. He could only go one screen at a time, because every time he would get to a new screen in his browser, he would have to disconnect from the internet, call me on the phone, ask me what to do next, hang up the phone, reconnect with his isp, click what I told him to click, and do it all over again when the next page came up.

So, he gets to the page where you sign up for a new mail account. I was following what he was doing in my browser, at my house. This guy has dial-up, so he can't be online, and talking to me. He calls me up and asks, "What do I click now?" I said, "Jack, seriously, there is only one thing to click on the entire page, 'For New Mail Account Click Here'."

"Should I click that when I get back online?"

"Yes!"

"OK, bye. I call you back."

-rrrrringgggggg

"Hi, Brian? It's Jack again."

"I figured, since it's been you the last eight times the phone rang."

"OK, there's the words, 'First Name', and a typing box next to it. What do I do?"

"Type you first name in the box."

"How?"

"With the keyboard."

"Is that the thing with letters and numbers, squiglies and OO's, pyramids and stars?"

"Yes."

"I tried that, but the letters don't come up in the box."

"Click the mouse in the box first."

"You're a genius. I'll call you back."

This went on for another hour and a half. I was so happy when Jack called me and asked if he really needed those wires going everywhere from the computer. I said, "No, but it is detrimental to performance if the cables are removed".

"I don't care. Tell me how to do it."

"Do you have a diagonal cutter?"

"If I do, I don't know it."

"Do you have a serrated knife?"

"Yes, I have that."

"Good. Take the serrated knife, and be careful so you don't ruin anything. With a sawing motion, cut the cables off as close to the computer as you can, without causing the connector to fall out. Do the same thing at each device."

"OK, let me call you back."

-rrrrrringggggggg

"It looks so much better, but I can't get the big bright thing to come on."

"Like I said, it's detrimental to performance, but it's better this way."

"DO you really think so?"

"Yes, I do that to all my PCs."

"Really?"

"Honest."

"That makes me fell a lot better about it."

"I always remember what you taught me, Jack: The way something looks, and how a person feels about it, are what's really important. Never mind if it performs any function."

"You remembered!!"

"How could I forget?"

"You you you ..."

"Are you calling me a you-you?"

"No, silly. You you you ..."

"You are calling me a you-you."

"I just can't think of what to call you."

"Call me watever makes you happy."

"OK, you 'Super Stud Muffin'.

"Besides that."

"Sorry. How about Sage."

"Sage is good."

"I guess I won't need to call you anymore for help with my computer."

"I'm really sad about that. I was growing to love spending four hours on the phone with you every Saturday morning. And you were always punctual, right at 6:00 am."
 
Old 11-12-2007, 02:45 AM   #403
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,842

Original Poster
Rep: Reputation: 260Reputation: 260Reputation: 260
Don't let the previous message scare you. That's just for entertainment. It isn't meant to apply to any users of linuxquestions.org.
 
Old 11-13-2007, 08:02 AM   #404
chittra
LQ Newbie
 
Registered: Nov 2007
Posts: 2

Rep: Reputation: 0
doubt

Is dd if=/dev/somedev of=/dev/null bs=512 count=1000; equivalent to read only operation?
if so, what does
1000+0 records in
1000+0 records out mean??
if its a read only operation, it would read 1000 records and since /dev/null is dummy file the write operation will not take place. then how 1000+0 records out happens?
 
Old 11-13-2007, 12:34 PM   #405
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Because /dev/null will still accept what ever you throw at it.

It's *not* a dummy. It just doesn't store what you throw it
anywhere, but discards it.



Cheers,
Tink
 
  


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 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 04:50 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration