Wednesday, February 22, 2017

FreeBSD使用移动硬盘的不同方式

FreeBSD使用移动硬盘的不同方式


????FreeBSD??????????????????????????????X?

X????????????????????Xorg+GNOME???????HALD????????
?????????????FreeBSD???????????????

????

?FreeBSD??????????????????????????????

??????

????????????????????????????????????????
????????USB??????????????USB??????
?????????????????????????
device scbus
device da
device pass
device uhci
device ohci
device ehci
device usb
device umass
????????????????????????????USB??????
???????FreeBSD Handbook?
????????????????????????

?????????

?????????????????????UFS?????
  • ??????????root????sysinstall?
Condigure ? Fdisk ? ????????Slice?????????????????UFS???????Use Entire Disk??????Write Changes??????Do not install a boot manager?????sysinstall?
  • ????sysinstall???????????sysinstall?
Condigure ? Label ? ????????Partition?????????Write?
?????????????????????Partition??????????????/tmp???????????root??????????root????????????????????????
????rc.conf??????????????????/tmp???
clear_tmp_enable="YES"
?????????????????Slice?????Slice???3?Partition?
??/dev?????
da0
da0s1
da0s1d
da0s1e
da0s1f

??????

???????????root??????????????????????????????????
  • ?????????/etc/devfs.rules?
[localrules=5]
add path da* mode 0660 group operator
????operator??????
???/etc/devfs.rules???/etc/devfs.conf?????????????????????????????
  • ?????????/etc/rc.conf?
devfs_system_ruleset="localrules"
??????/etc/devfs.rules???????
  • ?????????/etc/sysctl.conf:
vfs.usermount=1
?????????????
  • ???????????
?????????????/mnt????????????????????????????/mnt?????5?????
> ls /mnt/
fender_01 fender_02 fender_03 fender_04 fender_05
???????root??????????????fender_01,fender_02?fender_03?
# cd /mnt/
# mount /dev/da0s1d fender_01
# mount /dev/da0s1e fender_02
# mount /dev/da0s1f fender_03
???????fender_01,fender_02?fender_03?????????
# cd /mnt/
# chown fender:operator *
???fender?????operator????
# pw group mod operator -m fender
????????????fender?????????????

??HALD??????

????????????FreeBSD????????????????????????HALD????????
????????/usr/local/share/hal/fdi/preprobe/20thirdparty???
  • ??da.fdi??????
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
<device>
<match key="freebsd.driver" string="da">
<match key="freebsd.unit" int="0">
<merge key="info.ignore" type="bool">true</merge>
</match>
</match>
</device>
</deviceinfo>
????????HALD???????
  • ??acd.fdi??????
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="freebsd.driver" string="acd">
<match key="freebsd.unit" int="0">
<merge key="info.ignore" type="bool">true</merge>
</match>
</match>
</device>
</deviceinfo>
????????HALD??????????????????
???????X???????????????

?????????????

??????????????????????????????????????????????????????????????????????????LOL??
> cd
> cd bin/
> cat mount_rhd.sh
#! /bin/sh
mount /dev/da0s1d /mnt/fender_01;
mount /dev/da0s1e /mnt/fender_02;
mount /dev/da0s1f /mnt/fender_03;
> cat umount_rhd.sh
#! /bin/sh
sync;
umount /mnt/fender_01;
umount /mnt/fender_02;
umount /mnt/fender_03;
?????????????shell????????????????home???bin????????bin????shell???????????
???????????????????????cd?????????cd?????????home?? 8-)


Available link for download