原文:http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/CD-Writing-HOWTO.html
可以用 cdrecord -scanbus 來檢閱可用的裝置
Linux kernel 版本需高於 2.0.36 或 2.2.11
需要檢查 /dev/ 下是否有 sg device
若沒有,可以用 mknod sg0 c 21 0 來建立
若有多個,則 mknod sg1 c 21 1, mknod sg2 c 21 2 ….
需要以下 modules
scsi_mod
sg
sr_mod
loop
iso9660
ide-scsi
需要調整 cd-writer 所掛入的 driver(module)
– 若是 built-in, 在 lilo, kernel 啟動參數的地方加上 hdx=ide-scsi
– 若是 module, 則在 /etc/modules.conf 中加上
options ide-cd ignore=hdx
alias scd0 sr_mod
pre-install sg modprobe ide-scsi
pre-install sr_mod modprobe ide-scsi
pre-install ide-scsi modprobe ide-cd
假設 /dev/scd0 為 cd-writer
也可為 /dev/scd0 建立 symbolic link 到 /dev/cdrom 下
ln -s /dev/scd0 /dev/cdrom
工具軟體:
1.mkisofs
2.cdrecord
3.cdrdao
4.VCD
(進度顯示則可參考一些 GUI 的工具: xcdroast, BurnIT, cdtux )
一般來說 620MB on disk 約等同於 650MB on CDROM
製作 image 的方法:
mkisofs -r -o cd_image 目錄/
燒錄的方法:
cd-r 的指令是,
cdrecord -v speed=n dev=scsi_bus,scsi_id,scsi_lun -data cd_image
cd-rw 則再多加上 blank=… 以清除原先內容.
一般都是先 mkisofs, 再呼叫 cdrecord.
以下指令則是先確認來源的大小之後,再行燒錄:
#IMG_SIZE=`mkisofs -R -q -print-size 目錄/ 2>&1 | sed -e “s/.*=//”`
#echo $IMG_SIZE
[ “0$IMG_SIZE” -ne 0 ] && mkisofs -r 目錄/ | cdrecord speed=n dev=0,6,0 tsize=${IMG_SIZE}s -data –
音樂:
可先用 sox 把 wav 轉為 cdr,亦可直接燒錄:
cdrecord -v speed=n dev=0,6,0 -audio 1.cdr 2.cdr …
cdrecord -v speed=n dev=0,6,0 -audio 1.wav 2.wav …
cdrecord -v speed=n dev=0,6,0 -audio 1.au 2.au …
燒 mp3, 建議用 speed=1,避免燒太快,而使得 mpg321 來不及轉換資料.另外一個原因則是 mpg321 佔用CPU資源太多.
for I in *.mp3
do
mpg321 -cdr – “$I” | cdrecord -audio -pad -nofix –
done
cdrecord -fix
對燒:
cdrecord -v dev=0,6,0 speed=2 -isosize /dev/scd0
先放為 image 的話
dd if=/dev/scd0 of=cd_image
cdrecord -v dev=0,6,0 speed=2 -isosize cd_image
UDF 不知是否好用??
燒錄 cd-rw 時,可以用 blank=fast, 等同於快速抹除 CDRW.
續燒的方法(multi-session)
NEXT_TRACK=`cdrecord -msinfo dev=0,6,0`
echo $NEXT_TRACK
mkisofs -R -o cd_image2 -C $NEXT_TRACK -M /dev/scd0 目錄/
rsync HOWTO
Server
======
Put rsyncd.conf to /etc/xinetd.d/ .
Put rsyncd.secrets to /etc.
Then turn on rsync service: chkconfig rsync on
Client
======
Edit a text file contained your password and named “password”.
Then,
export RSYNC_RSH=/usr/bin/ssh
Run this to get the source from rsync server:
rsync -vzrtopg –progress –delete root@172.16.97.212::cpp . –password-file=/root/password
If you modified some thing, want to put them to rsync, run this command:
rsync -vzrtopg –progress –delete . root@172.16.97.212::cpp –password-file=/root/password
Notice
======
1. Server: The owner and permission of secret file must be correct! (0600)
2. Client: The owner and permission of password file must be correct, too!! (0600)
3. You may refer the log file to find why error happened.
rsyncd.conf
===========
uid = root
gid = root
use chroot = no
max connections = 4
syslog facility = local5
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
lock file = /var/run/rsync.lock
[cpp]
path = /root/cpp
comment = root
ignore errors
read only = no
list = yes
auth users = root
secrets file = /etc/rsyncd.secrets
rsyncd.secrets
==============
root:your-password
rsyncd usual syntax
===================
rsync -a srcdir remotehost:/destdir # Local -> Remote
rsync -a remotehost:/srcdir destdir # Remote -> Local
rsync -a -e ssh srcdir user@remotehost:/destidr # via SSH
rsyncd switchs
==============
-n Dry-Run, only simulate rsyncing.
-v,-vv,-vvv verbose.
–delete Remote all files in destination that doesn’t appear in source.
–delete-exclude Like –delete, but exclude specified files.
-z With compression.
-s Efficient with sparse files.
-b Append ‘~’ for existed files in destication.
–backup-dir=DIR Move existed files in destincation to DIR.
–exclude FILE Exclude specified files.