backing up /sys

Rick Stevens rstevens at vitalstream.com
Thu Jun 30 18:05:14 UTC 2005


Bob McClure Jr wrote:
> On Thu, Jun 30, 2005 at 05:45:29PM +0400, Alexey Fadyushin wrote:
> 
>>Bob McClure Jr wrote:
>>
>>
>>>I'm in the process of checking out a CD/DVD-based backup package.
>>>
>>>http://www.bluehaze.com.au/unix/cdbkup.html
>>>
>>>In my first test, I noticed in the error log a bunch of carps about
>>>file sizes changing in /sys.  I know that /proc is a pseudo filesystem
>>>comprising nothing but hooks into the kernel, and I know that I don't
>>>want to back that up.  /sys looks like the same sort of thing, full of
>>>directories that take up 0 bytes, down to files that ls reports as
>>>4096 bytes.
>>>
>>>Is it safe to assume I don't want to backup /sys?
>>>
>>>Cheers,
>>>
>>>
>>
>>/sys is a mount point for sysfs filesystem. Sysfs is a virtual 
>>filesystem similar to procfs in 2.6 line of Linux kernels.
>>From the kerlnel documentation (menuconfig help):
>>
>>The sysfs filesystem is a virtual filesystem that the kernel uses to
>>export internal kernel objects, their attributes, and their
>>relationships to one another.
>>
>>Therefore, you do not need to backup it, the filesystem and its content 
>>will be recreated by kernel when mounted.
>>
>>Alexey Fadyushin.
>>Brainbench MVP for Linux
>>http://www.brainbench.com
> 
> 
> Ok, now I have a question.  "mount" shows (among other things)
> 
>   none on /proc type proc (rw)
> 
> but no equivalent for /sys.  If I
> 
>   cd /
>   find . -depth -mount | cpio -o ....
> 
> I know it will record /proc but none of its contents.  Will it treat
> /sys the same way?  Or would a restore from such a backup be innocuous
> as far as the contents of /sys goes?

It should, but /sys and /proc are virtual.  You really only need the
mountpoints themselves and not their contents.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
- Do not taunt the sysadmins, for they are subtle and quick to anger -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list