dd a partition..

Discuss Applications

dd a partition..

Postby agent007 » Wed Oct 29, 2003 5:57 am

hi all,

When imaging a partition, is:

dd if=/dev/hda1 of=test.iso

same as

dd if=/mnt/hda1 of=test.iso

Will any sectors be left out when using the /mnt instead of /dev?

thanks.
~
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Void Main » Wed Oct 29, 2003 8:10 am

Completely different. /dev/hda1 is a special device file, /mnt/hda1 is nothing more than a directory (unless you created a special device file named /mnt/hda1 which I seriously doubt is the case). I suspect that trying to dd /mnt/hda1 will result in a 0 byte file and no really accomplish anything. To back up the partition sector by sector (an image) you would use the partition's special device name (/dev/hda1 in this case).
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby agent007 » Wed Oct 29, 2003 12:47 pm

But, /dev/hda1 is mounted on /mnt/hda1...
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Tux » Wed Oct 29, 2003 1:11 pm

That makes no difference to dd, as everything is a file. /mnt/hda1 just happens to be a directory and in fact dd will not make an image of it.

When you dd /dev/hda1 it will actaully make a raw image of everything on that partition, filesystem and all in a bare form.
/mnt/hda1 actually contains the files and directory structure of the disk which is translated to programs and you via the kernel and filesystem drivers drawn from the raw filesystem of the device located at /dev/hda1.

This is the purpose of mounting a disk, the OS (in our case Linux) will make the said partition/disk accessible at /mnt/whateverwherever using the filesystem you defined with -t or whatever fstab says.

Also you are naming your output image as *.iso, to me this would be confusing as I would think it was an ISO9660 CD-ROM image, but you are actually backing up a HDD partition. But, at the end of the day it is irrelavent so long as you know what it is.
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Void Main » Wed Oct 29, 2003 2:11 pm

What I really think you meant to ask is would it be better to "dd if=/dev/hda1 of=/dev/tape" or would it be better to "tar -cvzf /dev/tape /mnt/hda1". The former is an image of your partition not unlike a "Ghost" or "Drive Image" image in the Win world. The latter is a file system backup. There are advantages and disadvantages to each. For instance, in my example I dumped both to a tape device. The tar image I can selectively restore a file but that is a little harder with a dd to tape. On the other hand if you keep your dd image as a file on a larger file system you can actually mount the image as if it were still a partition. Also with the partition image the file system on the partition is irrelevent, you will have a good backup of the partition whether you can read the file system or not (NTFS, etc). Of course those are just a couple of examples of pros and cons, pickin the method depends on your circumstances.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Tux » Wed Oct 29, 2003 2:57 pm

Word :)
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby agent007 » Thu Oct 30, 2003 6:55 am

Allright, let me explain my little experiment to u guys..

My friend has a new AMD Athlon system with Windows XP loaded on it. The older system is without a HDD and the mobo does not support booting via CD-ROM. Btw, both the PC's have NIC's. So, he wanted me to get the old one up and running somehow.

What I decided to do was to use Remote Desktop on the 2nd system to connect to Windows XP's terminal services. Knoppix does have rdesktop installed but using a floppy to boot the CD is a long way to do a simple thing like this. Next, what I thought was to use TOMS'rbt GNU/Linux on a floppy and install Remote Desktop on that. But, this does not seem to be possible due to the absence of GCC...

Finally what I think will work is to temporarily put in a HDD, install Windows 98 on that, dd the partition, burn the whole thing onto a CD. Next, stick in a bootable floppy, access the CD and run win.com which would actually run Windows from the CD. Fire up the client and access Terminal Services on WinXP.

I've worked with LTSP before. But LTSP requires a server running with GNU/Linux installed on it which would not be feaseble in this case. Dunno how, but LTSP just make a boot floppy so that the clients can access the server and request the IP. Btw, do the boot floppies actually contain the Linux Kernel?

thanks.
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Void Main » Thu Oct 30, 2003 9:24 am

Turn the new Athlon box into a Linux server, problem solved. That's what I would do. :)
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby jaem » Fri Oct 31, 2003 4:23 pm

mkisofs is the tool to create isos (a la ISO-9660/rockridge/joliet). A dd will output a raw FAT partition, useless for CD-burning. Why don't you just buy a hard-drive? Even booting linux from a CD/NIC/Floppy always requires some tweaking, so I seriously doubt it wil be possible for W98.

Of course since knoppix cd includes a boot floppy image in case the cd is not bootable, you might stick around a bit with linux.

Or follow Void Main righteous solution.
jaem
n00b
n00b
 
Posts: 3
Joined: Fri Oct 31, 2003 4:00 pm


Return to Applications

Who is online

Users browsing this forum: No registered users and 1 guest

cron