Jump to content

rsync'ing partitions: what about /sys ?


Recommended Posts

Hi guys (and girls). I'm working on a simple script to mirror my partitions on a spare disk using rsync, and I've a question about the /sys dir: should I rsync it or just exclude it ?

 

What I want is a spare disk I could swap with the original one in case of serious trouble. Both disks (hda and hdc) have the same size. I've just 2 partitions (/ and /home) on hda.

 

I've done a first dd if=/dev/hda of=/dev/hdc to duplicate the whole disk including MBR. Now I want to run a rsync script every night to update hdc, something like

 

mount /dev/hc1 /mnt/sync_dir

rsync -uravH --delete --exclude-from=exclude_root.lst / /mnt/sync_dir

umount /mnt/sync_dir

mount /dev/hc2 /mnt/sync_dir

rsync -uravH --delete --exclude-from=exclude_home.lst /home /mnt/sync_dir

umount /mnt/sync_dir

 

It works fine (0 errors) for /home but I get a rsync error 23 ("some files could not be transfered") while rsync'ing / when /sys is not in the exclude_root.lst file, which looks like:

/proc

/mnt

/home

/etc/fstab

/tmp

 

I know /sys has something to do with udev and hotplugging. Is it safe to exclude it ? (i.e. Will the spare disk boot correctly if /sys has not been updated ?).

 

Thanx in advance for your (always appreciated) input.;)

 

Pierre

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...