You are not logged in.

#1 2010-10-12 13:43:34

jlacroix
Member
Registered: 2009-08-16
Posts: 576

[SOLVED] Is It Pointless to Image an Arch Machine?

When I got my new laptop, I set up Arch on it, installed all my favorite programs, set up the menus, and made sure everything worked perfectly. Then, I grabbed a Clonezilla LiveCD and took an image of it, just in case something were to happen to the hard drive and I was in a situation where I would need to reinstall Arch. But that got me thinking, is that even a good idea?

The benefit is that if my hard drive breaks, I just need to restore the Clonezilla image, and I'm back in business. However, I'm wondering if a lot of time passes between the creation date of the image and the date of failure, that when I do a pacman -Syu to get up to date, would so much change that it would just break the whole install?

In my career I've always created restore images of all my computers, but I'm wondering with Arch if that is even the most practical way of doing it. What are your thoughts?

Last edited by jlacroix (2010-10-13 19:35:37)

Offline

#2 2010-10-12 13:52:25

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

It would depend on your breakage. If I were you I would backup /etc, dot files, and the list of packages you have installed.

How long can you be down for? In any situation I could be down for 2-3 hours and although I would be in a bind I could still recover. (2-3 hours so be plenty of time to setup arch the way I want it)


Website - Blog - arch-home
Arch User since March 2005

Offline

#3 2010-10-12 14:08:34

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

Incremental backups are more suitable for Arch IMO. Your image taken after install will go "stale" pretty quickly, assuming your -Syu'ing regularly.

Offline

#4 2010-10-12 14:09:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

The small files - configs, documents, bookmarks etc. - you can backup many times a day. The big files that don't change much you can backup once a week / month. Keep backups of packages you won't find in the repos - some very old ones you desperately need.

Backing up tons of Arch packages doesn't make much sense to me.

Offline

#5 2010-10-12 14:17:32

Vermillion
Member
From: Switzerland
Registered: 2010-08-13
Posts: 43

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

if i got you right you want to avoid the effort of a reinstallation and not save your data... In that case you maybe should take a look at the archlinux installation framework (or short AIF). With a little work you can create an unattended installation which will take the pain of reinstallting your system almost away.

Offline

#6 2010-10-12 14:42:47

jlacroix
Member
Registered: 2009-08-16
Posts: 576

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

Yes, that's right. My actual data (/home) is backed up daily on two other hard drives (one of which is off site) so I'm not concerned at all about losing individual files. I am just trying to make re-installation of Arch faster.

As it turns out, an image only takes 15 minutes or less to restore. I'm sure that after six months it would probably be a huge upgrade when I Syu. However, it's a bit more than just reinstalling Arch, because I'm also setting up the application menus, and various settings too. I am interested in other alternatives. Building a list of packages may help, but I do have a list saved already that I could use.

What brought this up is that I am thinking about upgrading the hard drive on my laptop (I've had the laptop a few months) and I figure I'll just restore the image that I created, and then use a Gparted live CD to extend the partitions to the new size of the disk. Then, I remembered that I took the image before the move to Multilib, and several AUR packages have changed since, so if I restored the image I'd have some extra work to do.

Last edited by jlacroix (2010-10-12 15:10:07)

Offline

#7 2010-10-12 17:05:49

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

If you're reluctant to use other solutions, at least update your image regularly - either on a schedule e.g. once a week, or after every significant system change.

Offline

#8 2010-10-12 18:27:05

Texas
Member
From: Dallas, Texas
Registered: 2010-09-10
Posts: 131

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

I have three partitions on my laptop.  sda1 is "/", sda2 is copy of "/", and sda3 is "/home".  I image sda1 to sda2 as a hot backup of "/" before "pacman -Syu". I use PartImage.  This is some insurance if something breaks.  I can just tell grub to use sda2 rather that sda1.  My "/home" data remains on sda3.

Backing up the /home is different.  It is of utmost importance.  I have a usb HDD and a NAS for that.

Last edited by Texas (2010-10-12 18:27:50)

Offline

#9 2010-10-12 20:49:38

jlacroix
Member
Registered: 2009-08-16
Posts: 576

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

Thanks guys. I sat down and thought this over, and figured this is what I might do. Please let me know if you guys think it's a better solution.

First, I will make a new image, but it will contain ONLY base, no desktop interface, drivers, or what not. Then, I'll write a shell script that I can run that will install all of my favorite packages from Extra and AUR. Finally, I'll set up the shell script to copy the files from my /home partition on my server to the /home partition on my laptop (they use static IP's anyway).

That way, if I needed to restore my machine, I could restore the base image, then run the shell script. The way I figure it, is if something major changes in Arch, I only need to update the shell script, instead of an entire image.

The shell script would do the following things:
1.) Set up /etc/hosts
2.) Set up host name
3.) Set up the mirror list
4.) pacman -Syu
5.) Install a list of packages from Extra (and AUR if I can find a way to automate it)
6.) Update /etc/rc.conf
7.) Copy files from /home (server) to /home (laptop) via Unison

Maybe that's a better solution? If so this will be a fun project for me this weekend. smile

One quick question though. Is there anything that I might risk by having my shell script copy over a customized rc.conf and hosts file? I'm thinking I could just back up most of /etc and have the script restore the files. I don't think all that much changes in /etc as often as the rest of the distribution, correct?

Last edited by jlacroix (2010-10-12 20:50:04)

Offline

#10 2010-10-12 21:16:32

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

IMHO, it is pointless to back up the OS itself.

Save your important settings and data (specifically /etc and /home), and unless you have important data elsewhere, you should be good.

Unless you are setting up your menus on a per user basis (which would probably end up in /home anyway) /etc should have the info.

If you want to be more specific in what you copy, you could probably ignore rc.d, as that will be recreated after you reinstall.   Files that you would want specifically in /etc would be any that show up in the installer that you can edit at the start,  plus your X11 directory,  and any others that you specifically edit.

My 2 cents.


Knute

Offline

#11 2010-10-13 08:50:31

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

This is what I do...

I personally prefer to have everything backed up, and not just the files that regularelly change, and then I also never have to reinstall, allthough aif makes it fully automatic, so no biggie.

Then there's a couple of solutions to choose from.

I don't like dd'ing, as the empty space read is redundant.

Tar'ing up my system partition and home folder + dd'ing the mbr(grub) is a solution, but it's just much more effecient to do that block-wise as opposed to file-wise, so I prefer using an imaging solution instead.

I then decided to use partclone(supports ext4 with "used blocks only"), and then instead of making my own livecd with partclone, then I just took the pre-built clonezilla one, which also have a console-frontend to partclone and dd etc. and made some changes to make it backup or restore fully automatic, and also set it up to additionally tar/untar my home folder after the backup/restore of the system partition is done and before rebooting, and then I write the modified clonezilla iso to a usb stick(after having run isohybrid on it first to make it usb-bootable).

Then I make a backup(i.e. partclone image of system partition + tar of homefolder) of a fresh install and then after having run my post-install script which sets everything up I again make another backup, which I can revert to whenever wanting a fully clean and newly configured system, and then if wanting to change the use of some apps or settings, then I image back to the base backup and run the modified post-install script and make a new second backup.

About your other question, then it's okay to copy files over, but I personally just issue sed or echo commands from the post-install script.

Last edited by mhertz (2010-10-13 10:25:50)

Offline

#12 2010-10-13 15:49:06

kachelaqa
Member
Registered: 2010-09-26
Posts: 216

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

data backups, base installations, and system snapshots are three quite different purposes that can each be achieved in several different ways.

partition imaging is one solution that can work equally well in all three contexts.

it's silly to claim that imaging an arch machine is "pointless". imaging is just a means to an end.

Offline

#13 2010-10-13 17:10:32

jlacroix
Member
Registered: 2009-08-16
Posts: 576

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

kachelaqa wrote:

data backups, base installations, and system snapshots are three quite different purposes that can each be achieved in several different ways.

partition imaging is one solution that can work equally well in all three contexts.

it's silly to claim that imaging an arch machine is "pointless". imaging is just a means to an end.

I suppose my thought was about the number of updates that would be waiting since the install date, and whether or not too many updates could break the system. I tried Sidux a while back and the latest install media at the time was almost a year old. After installing sidux, the updates broke the entire system, as many packages were several versions higher. I was wondering if the same thing would happen to Arch? I suppose it's hypothetical, so it would be hard to say.

Offline

#14 2010-10-13 18:10:32

kachelaqa
Member
Registered: 2010-09-26
Posts: 216

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

jlacroix wrote:

I suppose my thought was about the number of updates that would be waiting since the install date, and whether or not too many updates could break the system. I tried Sidux a while back and the latest install media at the time was almost a year old. After installing sidux, the updates broke the entire system, as many packages were several versions higher. I was wondering if the same thing would happen to Arch? I suppose it's hypothetical, so it would be hard to say.

i think you're right that it's hard to say.

and i don't think it even necessarily depends on the relative age of the updates. potentially, any update can break the system at any time. even no updates can break the system, if the underlying hardware is changed.

Offline

#15 2010-10-13 18:36:10

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

There's no problem with updating older restored snapshots. It's the same as you can install arch from an older installer-version(core version) and then update afterwards, as arch is rolling release modelled. The only reason to use a newer installer-version to install,  is to get installer/aif updates and that there won't be as much to update afterwards...

Last edited by mhertz (2010-10-13 18:36:33)

Offline

#16 2010-10-13 19:35:18

jlacroix
Member
Registered: 2009-08-16
Posts: 576

Re: [SOLVED] Is It Pointless to Image an Arch Machine?

mhertz wrote:

There's no problem with updating older restored snapshots. It's the same as you can install arch from an older installer-version(core version) and then update afterwards, as arch is rolling release modelled. The only reason to use a newer installer-version to install,  is to get installer/aif updates and that there won't be as much to update afterwards...

Thank you. I'll probably just do that. In addition, I suppose there's no harm in me writing a shell script to restore my system in addition. I think I may make my imaging solution my primary solution, with Unison to restore my data after reimaging.

Thank you guys so much for all the input. I'll play around with it and see where I end up. smile

Offline

Board footer

Powered by FluxBB