Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am trying to setup a custom initrd that does a dd of /hda/sda2 to images.back files on a samba share or nfs share.
How do i go about creating this initrd image for pxe boot, have found some tutorials but they say create image dir and then copy files to directory then compress. But not sure what files i should have.
I haven't played with initrd to a large extent, so take everything I say with a huge grain of salt.
I'll assume your system is Debian (as per your user profile).
Look into the initramfs-tools (example `man initramfs-tools` and '/etc/initramfs-tools'). These are supposed to be used to make creating an initrd file easier. On my Debian system, these are already installed.
On many systems, Debian for example, the initrd will initially mount the root file system in read only mode. In that state, you can access all kernel modules and programs (though you may need to specify a path to /bin/dd). Also, an image can be easily made because the file system is entirely untouched. One of the scripts will change the root file system to read/write at a later stage.
In order to take advantage of that, I would recommend adding a brief script to /etc/initramfs-tools/local-bottom/ to mount your smb share, copy the dump, and unmount the smb share. Create the initrd, put it in place, and cross your fingers.
Have also been told that ntfs support for dd ing of an image is not very well supported.
My main thing is that i want to install 10 windows laptops with exact same image but do not want to use ghost.
Thanks and will let you know soon
Whoa, whoa! Overkill!
I have used Linux for this purpose and can tell you that you do not need to go anywhere near initrd to do it.
Instead, you will want to get your hands on a live CD. Knoppix is the original live CD and is a Debian fork. I highly recommend it, as it is what I have used in the past. DSL (D*** Small Linux) is a Knoppix fork that is trimmed down to fit on the mini CD discs; it may also be a good choice for this adventure (though I haven't used it as such).
Before I talk about the clone, you may want to investigate sysprep. sysprep is a tool from Microsoft that prepares a system to be cloned. It is useful for several reasons. (1) There is a unique identifier in the registry for each system. You can run into networking problems if multiple system claim the same ID. (2) If the hardware is different, windows does not automatically redetect, and will probably lock up. (3) If the partition is larger/smaller on the destination, you will need to resize.
sysprep does not actually clone the drive, but it does address each of these issues. After sysprep is run, the system will be shutdown. On next boot, Windows will run a part of the windows installer to touch up the new installation (only takes a few minutes per system; the partition resize is not default, you will need to set that yourself).
Oops, I need to go now. I'll finish this at first chance.
Sorry about that. (sysprep can be found on the windows CD, at least on the xp pro version.)
The Linux software tools that I recommend you learn about for this project are ntfsutils (specifically ntfsclone and ntfsresize), smbmount, and possibly gzip, dd, tee, mkfifo, and md5sum.
It is to be noted that ntfsclone works well for this, but they explicitly disclaim this use. There are situations where ntfsclone can give you problems. In my case, when cloning the first partition of a drive on one system to the second partition in another system. This results in a system that will not boot. I found a solution, but it doesn't sound like you will be doing that.
The basic idea is to mount the file share and use ntfsclone to make an image and save it there. Going the other direction is basically the reverse. When I've done it in the past, I've always piped the image through gzip (to compress it, for storage) and mk5sum (for verification).
Defragment the partition from windows first. A chkdsk also cannot hurt. If this is a fresh install on a full format, then never mind.
Use sysprep. It may add some headache at this stage, but it will remove headaches later.
When booting knoppix use "boot: knoppix 2 toram". The '2' means start in runlevel 2, command line only. Normally knoppix will start in runlevel 5, and start X with KDE. The 'toram' will load the entire knoppix image into memory. This makes loading knoppix take much longer, but run faster. It also allows you to use only one disk while restoring multiple systems simultaniously. It does require 1GB of ram (unless using DSL, it will boot much faster as it has a much smaller image, and only require 128MB I belive; remember "boot: dsl 2 toram")
pipe the image through gzip. This will cut down on the space required to store the image. If you don't intend to store it long, skip this step. I recommend gzip over bzip2 only because the former seems to be faster although the latter seems to compress better (ymmv).
use mkfifo and tee to pipe the image through md5sum both before and after it is gziped. Then when the image is restored, you can verify that the image was recovered from storage and transmitted properly. This isn't as hard as it might sound, but it involves named pipes which are not familiar to most people. These steps have added to my peace of mind.
If you need step by step instructions, let me know.
(It's not recommended, but if you are particularly daring, you could ignore the file server entirely and use named pipes, screen, and netcat to image them all from the original.)