<font size="2">
<p>I've been working on an OS backup script off and on for a little while, but have as of yet come up with a good solution that can fit as universally across all Linux systems in house. I've gotten to the point where I need to get it done, tested and put into production over the next couple of days. Any help or guidance on this would be beneficial.
</p>
<p>&nbsp;</p>
<p>Scenario:</p>
<p>Roughly 20 linux systems, most are RHELv3 with ext3 filesystems. However, there are also systems that are Debian, SuSe, Slackware, etc., or don't use ext2/3 but other filesystems&nbsp;such as reiserfs or xfs. We do use Tivoli Storage Manager for our nightly incrementals.
</p>
<p>Most systems have a partitioning scheme similar to the following:</p>
<p>Device Boot Start End Blocks Id System</p>
<div>/dev/hda1 * 1 13 104391 83 Linux</div>
<div>/dev/hda2 14 274 2096482+ 82 Linux swap</div>
<div>/dev/hda3 275 372 787185 83 Linux</div>
<div>/dev/hda4 373 4865 36090022+ 8e Linux LVM</div>
<p>With a filesystem layout similar to:</p>
<div>/dev/sda3 495908 302673 167632 65% /</div>
<div>/dev/sda1 100692 46883 48610 50% /boot</div>
<div>none 1282920 0 1282920 0% /dev/shm</div>
<div>/dev/vg00/lvol1 4285712 3167820 900192 78% /usr</div>
<div>/dev/vg00/lvol2 1007896 17492 939204 2% /tmp</div>
<div>/dev/vg00/lvol3 2015824 1568220 345204 82% /var</div>
<div>/dev/vg00/lvol4 2519632 826072 1591160 35% /opt</div>
<div>/dev/vg00/lvol5 2015824 1358488 554936 71% /home</div>
<div>/dev/vg00/lvol6 2015824 1568220 345204 82% /data</div>
<p>&nbsp;</p>
<p>There are additional filesystems that are primarily on other volume groups that I haven't listed. Those are mostly irrelevant so I've omitted the information.</p>
<p>&nbsp;</p>
<p>Goal:</p>
<p>I'm looking to create a script that will backup what I consider the primary OS filesystems to a filesystem on a remote server while ignoring the other filesystems and virtual systems such as /proc. The filesystems I'm considering to backup are:
</p>
<div>/</div>
<div>/boot</div>
<div>/usr</div>
<div>/var</div>
<div>/opt</div>
<div>/tmp</div>
<div>/home (if small enough, otherwise restore from incremental)</div>
<p>To restore, I would boot off of a live distro such as Knoppix, Slax, or similar and recreate the partions on the HDD (if necessary), then begin to restore the files across the network to either the same size drive or larger.
</p>
<p>&nbsp;&nbsp;</p>
<p>At first, I was looking at utilities such as tar or dump. However, these to me, seem to have limitations preventing me from doing what I'm after given the partitioning scheme and using LVM. I believe dd might be my best option, but I'm not sure if that would be the best route as I don't want to pull empty disk space or bad sectors that typically come with using dd.
</p>
<p>I've done a fair amount of googling, and reading various sources about this. However, most only deal with physical or logical partitions being the filesystems instead of LVM. Typically, these only cover using tar or dump and do not address how to restore on LVM filesystems. However, if I use dd to do the partitions, I would be taking everything on the disk including non-essential filesystems and blank diskspace wouldn't I?
</p>
<p>Am I stuck just using dd and taking all filesystems on the root/OS disk, or is there something that I'm not aware of?&nbsp; Again, any thoughts or suggestions on this would be quite appreciated.</p>
<p>Thanks!</p></font><br clear="all"><br>-- <br>-Shawn<br>