--- old-ed.xml 2006-07-15 20:53:17.000000000 +0200 +++ external-devices.xml 2006-05-12 23:10:40.000000000 +0200 @@ -1,156 +1,149 @@ + + - - - + Gentoo Documentation Guide Dimitry bradt - -This howto will show you how to use external (usb/firewire) storage devices. + This howto will show you how to use external (usb/firewire) storage + devices. - - 1.0 2006-05-12 HAL/pmount
Info

-HAL is a hardware abstraction layer, which is a piece of software that provides -a view of the various hardware attached to a system. In addition to this, HAL -keeps detailed metadata for each piece of hardware and provides hooks such that +HAL is a hardware abstraction layer, which is a piece of software that provides +a view of the various hardware attached to a system. In addition to this, HAL +keeps detailed metadata for each piece of hardware and provides hooks such that system and desktop-level software can react to changes in the hardware configuration in order to maintain system policy.

The most important goal of HAL is to provide plug-and-play facilities for -UNIX-like desktops with focus on providing a rich and extensible description of -device characteristics and features. One example of the functionality provided -by HAL is when you plug in a USB storage device. HAL can automatically create -an appropriate entry in the /etc/fstab file and create the corresponding mount -point in /mnt. Extra info: -http://www.ometer.com/hardware.html +UNIX-like desktops with focus on providing a rich and extensible description +of device characteristics and features. One example of the functionality +provided by HAL is when you plug in a USB storage device. HAL can automatically +create an appropriate entry in the /etc/fstab file and create the corresponding +mount point in /mnt. Extra info : http://www.ometer.com/hardware.html

-
configuring HAL

-Before emerging the needed programs you should enable KOBJECT_UEVENT and -CONFIG_HOTPLUG in your kernel. Search after these options with /, -or adapt the .config located in -/usr/src/linux/.config. +Before emerging the needed programs you should enable KOBJECT_UEVENT and +CONFIG_HOTPLUG in your kernel. Search after these options with "/", or adapt +the .config located in /usr/src/linux/.config.

 KOBJECT_UEVENT=y
 CONFIG_HOTPLUG=y
 

-Before emerging you need to enable the hal USE flag. +Before emerging you need to enable the hal use flag.

-You could also emerge kde-base/kioslaves with the hal USE flag. -KDE Has make some nice hal support. Read more at +You could also emerge kde-base/kioslaves with the hal use flag. +KDE Has make some nice hal support. Read more at http://wiki.kde.org/tiki-index.php?page=DBUS -
+
 # euse -E hal
 # emerge -v hal dbus hotplug
 # rc-update add dbus default
 # /etc/init.d/dbus start
 # rc-update add hald default
 # /etc/init.d/hald start
 

-Instead of configuring our software; we could just use some applications to do -this for us. +Instead of configuring our software; we could just use some +applications to do this for us.

-
+
 # echo "sys-apps/pmount ~x86" >> /etc/portage/package.keywords
 # emerge -v pmount
 # emerge -v ivman
 
At this point you may test this by typing media:/ in your Konqueror. (You will need to insert an external storage device into your USB-port.) -We put sys-apps/ivman in this howto because it gives the user a nice +We putted sys-apps/ivman in this howto because it gives the user a nice pup-up window and asks the user where he'd like to mount the new hardware.

-Now your window manager automatically asks you where he has to mount your -external devices. The only thing we could renice is let hal make symlinks of -our devices. We do this by making sure it is owned by group hal. +Now your window manager automaticly asks you where he has to mount your +external devices. The only thing we could renice is let hal make symlinks +of our devices. We do this by making sure it is owned by group hal.

-
-BUS=="usb", 
+
BUS=="usb", 
 SYSFS{serial}=="123456789011121314", SYSFS{product}=="JUMPDRIVE",\
 KERNEL=="sd?1", NAME="%k", SYMLINK="usbdrive", GROUP="hal"
 BUS=="usb", SYSFS{manufacturer}=="Sony", SYSFS{product}=="PSP Type A",\ 
 KERNEL=="sd?1", NAME="%k", SYMLINK="psp", GROUP="hal"
 BUS=="usb", SYSFS{manufacturer}=="Apple",  SYSFS{product}=="iPod",\
 KERNEL=="sd?2", NAME="%k", SYMLINK="ipod", GROUP="hal"
 

-and also edit /etc/fstab: +and also edit /etc/fstab

 /dev/usbdrive   /mnt/usbdrive   auto            noauto,rw,user                 0 0
 /dev/ipod       /mnt/ipod       auto            noauto,rw,user                 0 0
 /dev/psp        /mnt/psp        auto            noauto,rw,user                 0 0
 
- -External storage posibilities -
-Configuring the kernel +external storage posibilities +
configuring the kernel +

-Make sure the options below are marked like said below in your kernel config +Make sure the options below are marked like said below in your kernel config that is found at /usr/src/linux/.config.

These kernel-options are just generally. You should really look fist at your -lspci output and see for yourself if you need OHCI or UHCI. The options -below are set for UHCI. +lspci output and see for yourself if you need OHCI or UHCI. +The options below are set for UHCI.
 # vim /usr/src/linux/.config
 MSDOS_FS=y
 VFAT_FS=y
@@ -162,115 +155,109 @@
 USB_OHCI_HCD=n
 
-Build the kernel +build the kernel -
+
 # make
 # mount /boot/
 # cp arch/your arch/boot/bzImage
 # /boot/linux-$ver-gentoo-$release
 

-Now you should reboot and move further from this point after you reboot. +now you should reboot and move further from this point after you reboot

-
-Checking if hotplug detected your devices well +
checking if hotplug detected your devices well -
+
 # dmesg | grep usb-storage
 
 usb.c: USB device 4 (vend/prod 0xdda/0x2005) is not claimed by any active 
 driver.
 
-If this happens, it means you did not configure your kernel well. You should +If this happens, It means you did not configure your kernel well. You should look at your lspci and restart from where you started after the reboot.

-You can do this automatically by putting your driver name in +you can do this automaticly by putting your driver name in /etc/modules.autoload.d/kernel-2.{4|6}.

-
+
 # emerge sg3_utils
-# Description: apps for querying the sg SCSI interface
+# Description: apps for querying the sg SCSI interface 
 (contains rescan_scsi_bus.sh)
 

-And right after that: +and right after that :

-
+
 # mkdir /mnt/usbstick
 # mount -t vfat /dev/sda1 /mnt/usbstick
 

-If you can't mount then try the alternative kernel config above that enables -SCSI generic support. Then run the following that should give you the correct -device name. You can now mount with the correct name (Eg. -/dev/sdb1). You can also try with auto or msdos (for small cards) -as the filesystem type (mount -t msdos /dev/x /mnt/x). +If you can't mount then try the alternative kernel config above that enables +SCSI generic support. Then run the following that should give you the correct +device name. You can now mount with the correct name (Eg. /dev/sdb1). You can +also try with auto or msdos (for small cards) as the filesystem type +(mount -t msdos /dev/x /mnt/x).

-
+
 # sg_scan -i
 # sg_map
 
- -Editing your fstab -
-Mounting your external usb-devices +editing your fstab +
mounting your external usb-devices
 # MY USB STICK
 /dev/sda1             /mnt/stick      vfat        noauto,user,exec,sync     0 0
 

-Please note that you have to use vfat in the fstab file, because if you choose -auto you won't get the full name but only the first 8 chars. Add the option -"sync" to have synchronous changes between the actual usb mass storage device -and the place that it's been mounted. Otherwise it would be done while you -unmount it. This has the advantage of not losing data if you forgot to unmount -a device and also you would see how long it will take when you are transferring -data to it. You don't need to use vfat in the fstab file as long as -/etc/filesystems is set up properly. +please note that you have to use vfat in the fstab file, because if you choose +auto you won't get the full name but only the first 8 chars. Add the option +"sync" to have synchronous changes between the actual usb mass storage device +and the place that it's been mounted. Otherwise it would be done while you +unmount it. This has the advantage of not losing data if you forgot to unmount +a device and also you would see how long it will take when you are transfering +data to it. You don't need to use vfat in the fstab file as long as +/etc/filesystems is set up properly.

- -
-
-Configuring your filesystems +
configuring your filesystems

-Specifically, if vfat exists in /etc/filesystems before other fat -file systems or by itself with an asterisk on the last line, it will be tried -first during a mount. Read the mount (8) man page for more details. +Specifically, if vfat exists in /etc/filesystems before other fat file systems +or by itself with an asterisk on the last line, it will be tried first during a +mount. Read the mount (8) man page for more details.

 #
 # This file defines the filesystems search order used by a
 # 'mount -t auto' command.
@@ -287,16 +274,14 @@
 
- -Mounting your Windows partitions -
-The different filesystem types +Mounting your windows partitions +
the different filesystem types
 # mount -t ntfs /dev/hda1 /mnt/win
 # mount -t vfat /dev/hda2 /mnt/data
 
@@ -305,34 +290,30 @@
user permissions

-On all three filesystems (MS-DOS, VFAT, NTFS), mount lets you pass the uid and -gid options, which let you set the user and group IDs of who the files are +On all three filesystems (MS-DOS, VFAT, NTFS), mount lets you pass the uid and +gid options, which let you set the user and group IDs of who the files are chown'd to when the filesystem is mounted. To find out the values for uid and gid, run id $user.

-umask: octal file permissions
+umask: octal file permissions You can change permissions using the parameter umask. But be aware that it must be the bitmask of permissions that are not present for the mountpoint. It is an octal number, formed like this:

    -
  • - Character '0': Indicates that this is an octal number, not decimal -
  • -
  • First digit: owner user permissions
  • -
  • Second digit: owner group permissions
  • -
  • - Third digit: world permissions (every other user on the system). -
  • +
  • character '0': Indicates that this is an octal number, not decimal.
  • +
  • first digit: owner user permissions
  • +
  • second digit: owner group permissions
  • +
  • third digit: world permissions (every other user on the system)
M | R W X ------------- 0 | * * * @@ -343,79 +324,77 @@ 5 | - * - 6 | - - * 7 | - - -
-# my windows partition
+#my windows partition
 /dev/hda1  /mnt/ntfs  ntfs  uid=1000,gid=100  0 0
 

-utf8
-You may also add utf8 option, if you can't see some files with international -characters in filenames. +utf8 You may also add utf8 option, if you can't see some files with +international characters in filenames

-/etc/fstab /dev/hda1  /mnt/vfat  vfat  ro,utf8  0 0
+e.g. /etc/fstab : /dev/hda1  /mnt/vfat  vfat  ro,utf8  0 0
 

-For more options: +for more options :

-
-# man mount 8
+
+# man mount(8)
 
-
-Captive NTFS +
+captive ntfs

-We need sys-fs/captive (Description: Captive uses binary Windows drivers -for full NTFS r/w access.) to get this to work. For now Captive is masked so -you need to unmask it first: +We need 'sys-fs/captive' (Description: Captive uses binary Windows drivers +for full NTFS r/w access.) to get this to work. For now Captive is masked so +you need to unmask it first

-
+
 # echo "sys-fs/captive ~x86" >> /etc/portage/package.keywords
 

-Let's emerge captive now: +let's emerge captive now

 # emerge captive
 

-Now load the appropriate kernel module and make it load at boot +Now load the apropriate kernel module and make it load at boot

-
+
 # modules-update
 # modprobe fuse
 # echo "fuse" >> /etc/modules.autoload.d/kernel-2.6
 

-Congrats; Captive is now installed. To acquire the necessary filesystems -drivers you should run the following command to locate your ntfs drives in a -nice wizard. You should choose to download the appropriate drivers from -http://microsoft.com (You need a Windows SP2 license to do this -legal.) (It doens't matter if your partitions are mounted or not; The program -looks for itself after the right partitions.) Caution: you need X-windows for -this app. +Congrats; Captive is now installed. To acquire the necessary filesystems +drivers you should run the following command to locate your ntfs drives in a +nice wizard. You should choose to download the propriate drivers from +microsoft.com (You need a Windows SP2 license to do this legal.) (It doens't +matter if your partitions are mounted or not; The programm looks for itself +after the right partitions.) Caution : you need X-windows for this app.

-
+
 # captive-install-acquire
 

After you walked through the wizard you should now be able to mount your windows partitions read/write. @@ -432,21 +411,20 @@

 /dev/hda2          /windows          captive-ntfs     users      0 0
 

-Caution: You'll need to recompile fuse if you update your kernel! +Caution : You'll need to recompile fuse if you update your kernel !

-
+
 # modprobe -r fuse
 # emerge sys-fs/fuse
 # modules-update
 # modprobe fuse
 
-