Hitchhiker's Guide to Openbsd


- How do I duplicate a filesystem?


Download 1.27 Mb.
Pdf ko'rish
bet142/258
Sana04.04.2023
Hajmi1.27 Mb.
#1328980
1   ...   138   139   140   141   142   143   144   145   ...   258
Bog'liq
obsd-faq49

10.2 - How do I duplicate a filesystem?
To duplicate your filesystem use 
dump(8)
 and 
restore(8)
. For example, to duplicate everything under 
directory 
SRC
to directory 
DST
, do a: 
cd /SRC; dump 0f - . | (cd /DST; restore -rf - )
dump is designed to give you plenty of backup capabilities, and it may be an overkill if you just want to 
duplicate a part of a (or an entire) filesystem. The command 
tar(1)
may be faster for this operation. The 
format looks very similar: 
cd /SRC; tar cf - . | (cd /DST; tar xpf - )
10.3 - How do I start daemons with the system? (Overview of rc
(8))
OpenBSD itself uses an 
rc(8)
 style startup. This uses a few key files for startup. 

/etc/rc - Main script. Should not be edited. 

/etc/rc.conf - Configuration file used by /etc/rc to set startup parameters for the system. Should not 
be edited. 

/etc/rc.conf.local - Configuration file that overrides settings in /etc/rc.conf so you don't have to 
touch /etc/rc.conf itself, which is important when upgrading your system. 

/etc/netstart - Script used to initialize the network. Shouldn't be edited. 

/etc/rc.local - Script used for local administration. This is where new daemons or host specific 
http://www.openbsd.org/faq/faq10.html (2 of 32)9/4/2011 10:02:15 AM


10 - System Management
information should be stored. 

/etc/rc.securelevel - Script which runs commands that must be run before the security level 
changes. See 
init(8)

/etc/rc.shutdown - Script run on shutdown. Put anything you want done before shutdown in this 
file. See 
rc.shutdown(8)
 
How does rc(8) work?
The main files a system administrator should concentrate on are /etc/rc.conf (for guidance), /etc/rc.conf.
local (for changes), /etc/rc.local and /etc/rc.shutdown. To get a look of how the rc(8) procedure works, 
here is the flow: 
After the kernel is booted/etc/rc is started: 

Filesystems are checked. 

Default configuration variables are read in from /etc/rc.conf, then local changes to those variables 
are read from /etc/rc.conf.local. Settings in rc.conf.local will override those in rc.conf. 

Filesystems are mounted 

Clears out /tmp and preserves any editor files 

Configures the network via /etc/netstart 

Configures your interfaces up. 

Sets your hostname, domainname, etc. 

Starts system daemons 

Performs various other checks (quotas, savecore, etc) 

Runs /etc/rc.firsttime 

Runs /etc/rc.local 

Processes the scripts in /etc/rc.d 

Download 1.27 Mb.

Do'stlaringiz bilan baham:
1   ...   138   139   140   141   142   143   144   145   ...   258




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling