Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to use dd to copy whatever data I can from a bad to a good disk but bumped into a problem that dd retires the same sector forever (or at least hours).
I have a question. I would like to use dd to wipe a drive, i can do this no problem with the command:
dd if=/dev/zero of=/dev/hda bs=1024
what i want to do is actually email a log with the date, time, computer name, and wether the script completed okay to someone.
How could i do this at the command line? Keep in mind i would like to use the a very minimal kernel install to do this. (I think im going to have to add mail to tthe kernel)
lol, it is working fine, despite that 15GB problem!
I have a temporary HD(80Gb) to put the 40GB data to fix this problem... sorry but I didnt understand correctly your last tips...
so 1st I need to put hda1 (15gb) in hdb1 in some way, but I need to create partitions 1st in this temporary HD right?
then will I need to format the hda1? how is that done?
then, transfer the data back to where it belongs but using all space provided by 37gb partition, how is that dd done?
I have read the 1st post, but it seems that it didnt work the way I liked. sorry but because I'm not good in english maybe I missed some word
thanks
I was able to do the trick with cp -a * /mnt/backup
then mkfs.ext3 /dev/hda1
then files back with cp -a again..
then it certainly would work...
I've read this in a google search, it seems that dd does not work right when copying from a small to a bigger drive...
external links (this one was quite comprehensive
"Unix dd command and image creation"
by Softpanorama: (slightly skeptical) Open Source Software Educational Society http://www.softpanorama.org/Tools/dd.shtml
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
Sorry this took me so long. I was away.
Quote:
Originally Posted by booyaadewd
Good Morning,
I have a question. I would like to use dd to wipe a drive, i can do this no problem with the command:
dd if=/dev/zero of=/dev/hda bs=1024
what i want to do is actually email a log with the date, time, computer name, and wether the script completed okay to someone.
How could i do this at the command line? Keep in mind i would like to use the a very minimal kernel install to do this. (I think im going to have to add mail to tthe kernel)
thanks
booyaa
If you boot from a live CD, such as Helix, which is linked in the OP, you can run dd, and email the logs entries with the live CD. Knoppix would also work for this. I don't recommend using the same kernel you are erasing to run dd. You should use a live CD.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
ddrescue
Quote:
Originally Posted by psjoberg
I'm trying to use dd to copy whatever data I can from a bad to a good disk but bumped into a problem that dd retires the same sector forever (or at least hours).
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
mke2fs
Quote:
Originally Posted by NapalmD
lol, it is working fine, despite that 15GB problem!
I have a temporary HD(80Gb) to put the 40GB data to fix this problem... sorry but I didnt understand correctly your last tips...
so 1st I need to put hda1 (15gb) in hdb1 in some way, but I need to create partitions 1st in this temporary HD right?
then will I need to format the hda1? how is that done?
then, transfer the data back to where it belongs but using all space provided by 37gb partition, how is that dd done?
I have read the 1st post, but it seems that it didnt work the way I liked. sorry but because I'm not good in english maybe I missed some word
thanks
Use the command mke2fs to make a ext2 or ext3 file system. man mke2fs for info
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
I'm limited on space.
Quote:
Originally Posted by Tinkster
Have you considered overhauling the original post in terms of layout/paragraph
and colorisation? The content is fine, but it's such an eye-sore.
Cheers,
Tink
Tink,
I'm almost at the maximum word count in the OP. I don't have much flexibility on paragraph styling, although I admit a little more "white space" would be attractive. Blank lines count toward total word count, so I'm in a pinch. If you would PM me I would be willing to listen to some thoughts on colorisation. I myself am not able to PM you for lack of sufficient board privileges. I'm open to suggestions, but this is off topic.
I used to extract boot info from Linux partitions by copying the first 512 bytes to a file, like so :
dd if=/dev/<partition with boot info> of=bootsect.lnx bs=512 count=1
The produced file is suitable to work with XP's ntldr, editing boot.ini. This way dual boot is clean and easy, since upgrading Windows won't wipe Linux's boot info as long as you keep the file.
But this only works for simple partitions. How can I make it work with LVM or MDraid partitions? Where is the boot info located in them?
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
Quote:
Originally Posted by sardaukar_siet
Hello.
I used to extract boot info from Linux partitions by copying the first 512 bytes to a file, like so :
dd if=/dev/<partition with boot info> of=bootsect.lnx bs=512 count=1
The produced file is suitable to work with XP's ntldr, editing boot.ini. This way dual boot is clean and easy, since upgrading Windows won't wipe Linux's boot info as long as you keep the file.
But this only works for simple partitions. How can I make it work with LVM or MDraid partitions? Where is the boot info located in them?
Thanks in advance!
Your are speaking of sector 1 on the HDD. This holds the partition table, among other things. Raid and LVM are special considerations. With software raid you must disconnect all but one disk, copy the info you need, make all your changes, and rebuild the raid array. This only works with RAID 0. Other types of raid will not respond well to dd. LVM is a special type of volume where the description is kept in an extended partition. How to find this information is really quite complex, and you have to have a good eye for what you looking for. These two types of applications are poor for using dd.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.