This is a discussion on disk image creation & restauration within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hi everybody, How can I create and copy (with which program) a disk image of my / partition to ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi everybody, How can I create and copy (with which program) a disk image of my / partition to a /backup partition ? And more important how can I restore it at the boot time ? The best solution whould be to have the different images on a server and to restore them on each client. What kind of solutions exist on Linux ? thanks for your help Antoine |
| |||
| the problem is that there are 12 clients that have to be reinstalled every morning in a pretty simple way. Now imagine you copy the huge tar file of the / partition on the backup partition. Ok. But how can you restore it automatically if the / partition is destroyed ? I can not boot manually each client with a rescue disk, reformat the /, untar the think and copy it to /. I would have to come at 5 AM every morning ! do you understand my problem ? Antoine |
| |||
| Antoine Logean wrote: > the problem is that there are 12 clients that have to be reinstalled > every morning in a pretty simple way. > > Now imagine you copy the huge tar file of the / partition on the backup > partition. Ok. But how can you restore it automatically if the / > partition is destroyed ? I can not boot manually each client with a > rescue disk, reformat the /, untar the think and copy it to /. I would > have to come at 5 AM every morning ! Ooof. Dude, you need to learn how to use tftp to install disk images online. And include the details when you ask for solutions, the devil is in the details. Also, geneerally ignore Peter. he cops a really hard attitude on the newbies, and his answers often leave out critical bits. |
| |||
| In comp.os.linux.setup Antoine Logean <al@biolinux.ch> wrote: > the problem is that there are 12 clients that have to be reinstalled > every morning in a pretty simple way. > Now imagine you copy the huge tar file of the / partition on the backup > partition. Ok. But how can you restore it automatically if the / > partition is destroyed ? I can not boot manually each client with a By making the partition first! Next silly question? > rescue disk, reformat the /, untar the think and copy it to /. I would > have to come at 5 AM every morning ! > do you understand my problem ? No. You are an idiot. Have you ever heard of scripting? It appears NOT. Here, have a free conslutancy: sfdisk < sfdisk.save mke2fs /dev/hda5 mkswap /dev/hda2 mount /dev/hda5 /mnt tar xzvfC /image.tgz /mnt Put it in /bin/rc on the live cdrom, and boot with init=/bin/rc. That will be $0. Plus the cost of my education. Which makes up for yours. Peter |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Antoine Logean wrote: | Hi everybody, | | How can I create and copy (with which program) a disk image of my / | partition to a /backup partition ? And more important how can I restore | it at the boot time ? The best solution whould be to have the different | images on a server and to restore them on each client. | | What kind of solutions exist on Linux ? | | thanks for your help | | Antoine | You could use find and cpio (in -p mode) to do the copy from / to /backup. You could use it the other way to restore. Why would you want to restore at boot time? If your hardware is so bad that a total restore is required every time you boot, you should spend your time getting the hardware fixed. As a user, I would find having my files all restored to some time in the past quite intolerable. It would mean that nothing I did between reboots would, in fact, have been done. What is the real problem you are trying to solve? - -- ~ .~. Jean-David Beyer Registered Linux User 85642. ~ /V\ Registered Machine 73926. ~ /( )\ Shrewsbury, New Jersey http://counter.li.org ~ ^^-^^ 7:10am up 15 days, 12:03, 2 users, load average: 2.23, 1.98, 1.53 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/MOOxPtu2XpovyZoRAppIAJ9fy3XyInHYahZKfmLNQGL90jlQKg CcD6M7 2z9d2FlOMna2cw0ht+9KnA8= =l6js -----END PGP SIGNATURE----- |
| |||
| Peter T. Breuer wrote: > In comp.os.linux.setup Antoine Logean <al@biolinux.ch> wrote: > >>the problem is that there are 12 clients that have to be reinstalled >>every morning in a pretty simple way. > > >>Now imagine you copy the huge tar file of the / partition on the backup >>partition. Ok. But how can you restore it automatically if the / >>partition is destroyed ? I can not boot manually each client with a > > > By making the partition first! Next silly question? > > >>rescue disk, reformat the /, untar the think and copy it to /. I would >>have to come at 5 AM every morning ! > > >>do you understand my problem ? > > > No. You are an idiot. Have you ever heard of scripting? It appears > NOT. Here, have a free conslutancy: > > sfdisk < sfdisk.save > mke2fs /dev/hda5 > mkswap /dev/hda2 > mount /dev/hda5 /mnt > tar xzvfC /image.tgz /mnt > > Put it in /bin/rc on the live cdrom, and boot with init=/bin/rc. > > That will be $0. Plus the cost of my education. Which makes up for > yours. *Sigh*. The bit that Peter entirely left out, under the "pay no attention to that man behind the curtain" approach to technical support, is the part where the machine has to auto-reboot every morning at 5am and load the scripting to do this. There are a couple of ways. A locked down partition that has these tools embedded in it and manipulates the LILO reboot arguments or grub.conf arguments to reboot once and once only with the newly installed partition is possible, and reload the whole mess every time after that, is one trick. But this can be done more gracefully with tools such as tftp and various auto-installation tools. Another is to leave a spare partition to install the OS image into, usually in scratch space or another disk, reboot to that partition, then recopy *that* OS image back to the original partition. You can get away with quite a lot of tweaking this way. Keeping the tarball or other image up to date is its own problem. Either designate a machine as "the source machine(tm)", or once you've made a tarball, you can uncompress the tarball to a specific directory and "chroot" to that directory to do all sorts of reconfiguration, update, etc. without even requiring a dedicated machine to work from. |
| |||
| Jean-David Beyer wrote: > Why would you want to restore at boot time? If your hardware is so bad > that a total restore is required every time you boot, you should spend > your time getting the hardware fixed. > > As a user, I would find having my files all restored to some time in the > past quite intolerable. It would mean that nothing I did between reboots > would, in fact, have been done. > > What is the real problem you are trying to solve? This is extremely common in computing cluster machines where user's do not *have* local home directories, and all software should be re-installed regularly to prevent people leaving littls packages or messed up configurations for each other. |
| |||
| Nico Kadel-Garcia wrote: > Jean-David Beyer wrote: > > >> Why would you want to restore at boot time? If your hardware is so bad >> that a total restore is required every time you boot, you should spend >> your time getting the hardware fixed. >> >> As a user, I would find having my files all restored to some time in the >> past quite intolerable. It would mean that nothing I did between reboots >> would, in fact, have been done. >> >> What is the real problem you are trying to solve? > > > This is extremely common in computing cluster machines where user's do > not *have* local home directories, and all software should be > re-installed regularly to prevent people leaving littls packages or > messed up configurations for each other. > I never heard of such a thing. If a user has no local home directory, how do people leave little packages for a user? Surely the ordinary users are not in a position to create home directories on the local machine for other users (or even themselves). If I understand the situation you describe, I would assume you set it up so no local files of any kind can be created (except by the super user), so local users cannot cause any problems like this. Anyone screwing around would have to do it on the remote file server, and that should be set up so users can affect only their own files. What am I missing? -- .~. Jean-David Beyer Registered Linux User 85642. /V\ Registered Machine 73926. /( )\ Shrewsbury, New Jersey http://counter.li.org ^^-^^ 7:55am up 15 days, 12:48, 2 users, load average: 2.07, 2.08, 2.08 |
| ||||
| thanks Jean-David, I will also try cpio. Seem to be a powerfull tool. The different workstations are dedicated to lessons on computer security. The students will try different tools in order to challenge the security of the platform. Although they will have limited privileges we want to have a simple restore procedure that can establish a clean, uncompromised lab environment if needed after certain activities. (The next time I will explain all the details at the begining of the discussion, sorry Peter). Antoine |