Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 92655 Details for
Bug 111551
Request documentation: Additional storage guide
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
addional storage
111551.xml (text/plain), 15.39 KB, created by
Dimitry Bradt (RETIRED)
on 2006-07-24 15:28:41 UTC
(
hide
)
Description:
addional storage
Filename:
MIME Type:
Creator:
Dimitry Bradt (RETIRED)
Created:
2006-07-24 15:28:41 UTC
Size:
15.39 KB
patch
obsolete
><?xml version="1.0" encoding="UTF-8"?> ><!-- $Header$ --> ><!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> > ><guide link="/doc/en/external-devices.xml"> ><title>External Storage Devices in Gentoo</title> > ><author title="Author"> > <mail link="diox@swords.be">Dimitry Bradt</mail> ></author> ><author title="Editor"> > <mail link="welp@01welp.co.uk">Peter Weller</mail> ></author> > ><abstract> >This howto will show you how to use external (usb/firewire) storage devices. >The guide also covers mounting Windows partitions and using iPods. ></abstract> > ><!-- The content of this document is licensed under the CC-BY-SA license --> ><!-- See http://creativecommons.org/licenses/by-sa/2.5 --> ><license/> > ><version>1.1</version> ><date>2006-07-20</date> > ><chapter> ><title>HAL/pmount</title> ><section> ><title>Info</title> ><body> > ><p> >HAL stands for Hardware Abstraction Layer, a piece of software which provides >a view of the various pieces of hardware attached to a system. In addition to >this, HAL also keeps detailed metadata for each piece of hardware and provides >hooks so that system and desktop-level software can react to changes in the >hardware configuration in order to maintain system policy. ></p> > ><p> ><c>pmount</c> is a simple program that allows users to mount devices which are >not found in <path>/etc/fstab</path>. ></p> > ><p> >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 <path>/etc/fstab</path> file and create the >corresponding mount point in <path>/mnt</path>. Extra information can be found >here: <uri>http://www.ometer.com/hardware.html</uri> ></p> > > > ></body> ></section> ><section> ><title>Configuring HAL</title> ><body> > ><p> >Before emerging the needed programs you should check that <c>udev</c> works. >You can test this by plugging a USB-storage device into your computer. If your >sys-logger (in most cases <c>syslog-ng</c> which you can find at workspace 12 >(ctrl-alt-F12) or in your messages) makes the apropriate link into your ><path>/dev</path>. ></p> > ><pre caption="Syslog-ng output on inserting an usb-memory stick"> ># <i>tail -n 18 /var/log/messages</i> > >scsi4 : SCSI emulation for USB Mass Storage devices >usb-storage: device found at 4 >usb-storage: waiting for device to settle before scanning >Vendor: PEAK II Model: Flash Drive Rev: 3000 >Type: Direct-Access ANSI SCSI >revision: 00 >SCSI device sdc: 503808 512-byte hdwr sectors (258 MB) >sdc: Write Protect is off >sdc: Mode Sense: 43 00 00 00 >sdc: assuming drive cache: write through >SCSI device sdc: 503808 512-byte hdwr sectors (258 MB) >sdc: Write Protect is off >sdc: Mode Sense: 43 00 00 00 >sdc: assuming drive cache: write through >sdc: sdc1 >sd 4:0:0:0: Attached scsi removable disk sdc >sd 4:0:0:0: Attached scsi generic sg2 type 0 >usb-storage: device scan complete >scsi.agent[30478]: disk at >/devices/pci0000:00/0000:00:0b.2/usb1/1-5/1-5:1.0/host4/target4:0:0/4:0:0:0 ></pre> > ><note> >If it isn't working you can configure it with this guide to udev; ><uri link="/doc/en/udev-guide.xml">Gentoo udev Guide</uri> ></note> > ><p> >As well as checking that <c>udev</c> works, you should also enable ><c>KOBJECT_UEVENT</c> and <c>CONFIG_HOTPLUG</c> in your kernel. Search for the >following options with <c>/</c>, or edit <path>/usr/src/linux/.config</path> to >include them. ></p> > ><pre caption="/usr/src/linux/.config"> ><var>KOBJECT_UEVENT=y</var> ><var>CONFIG_HOTPLUG=y</var> ></pre> > ><p> >Before emerging any packages, you will need to enable the <c>hal</c> USE flag >in your make.conf. ></p> > ><note> >You could also emerge <c>kde-base/kioslaves</c> with the <c>hal</c> USE flag. >KDE has make some nice HAL support. Read more at ><uri>http://wiki.kde.org/tiki-index.php?page=DBUS</uri> ></note> > ><pre caption="Installing HAL"> ># <i>euse -E hal</i> ># <i>emerge -v hal dbus hotplug</i> ># <i>rc-update add dbus default</i> ># <i>/etc/init.d/dbus start</i> ># <i>rc-update add hald default</i> ># <i>/etc/init.d/hald start</i> ></pre> > ><p> >Instead of configuring the software manually, we can just use various pieces of >software to do this for us. ></p> > ></body> ></section> > ><section> ><title>Autoconfiguring software (for KDE only)</title> ><body> > ><note> >If you are not using <c>KDE</c> you should move on to the next chapter: ><uri link="/doc/en/additional_storage#doc_chap2">Chapter two</uri> ></note> > ><pre caption="Autoconf software"> ># <i>emerge -v pmount</i> ># <i>emerge -v ivman</i> ># <i>rc-update add ivman default</i> ># <i>/etc/init.d/ivman start</i> ><comment>(after this, you need to add your user to the plugdev group, after >running this command, you should restart X or log out then in again)</comment> ># <i>gpasswd -a username plugdev</i> ><comment>(now start ivman as normal user so that external devices get mounted >with the correct permissions)</comment> >$ <i>ivman&</i> ></pre> > ><note> >At this point you may test this by typing <c>media:/</c> in Konqueror or, if >you're using Gnome, typing <c>computer:///</c> in Nautilus. Whatever you're >using, you can also just use <c>mount</c> to see what devices are mounted where. >You should use <c>pumount</c> to unmount drives. >(You will need to insert an external storage device into your USB-port.) ></note> > ><note> >We included <c>sys-apps/ivman</c> in this howto because, when using it, as soon >as a device is plugged in, a pop-up window appears asking the user where he'd >like to mount the <e>new</e> hardware. ></note> > ><p> >Now your window manager should automatically ask you where you would like your >external devices mounted. The only thing we could do to enhance the way in >which hal works, is let hal make symlinks of our devices. We can do this by >making sure it is owned by group hal. ></p> > ><pre caption="/etc/udev/rules.d/hal.rules"> >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" ></pre> > ></body> ></section> ></chapter> > ><chapter> ><title>External storage possibilities</title> ><section> ><title>Configuring the kernel</title> ><body> > ><p> >Make sure the options below are set as follows in your kernel config, which can >be found at <path>/usr/src/linux/.config</path>. ></p> > ><note> >These kernel-options are very general, you should first look at the output of ><c>lspci</c> (<c>emerge pciutils</c> if you haven't got it installed) and check >for yourself to see if you need OHCI or UHCI. The options below have been set >for UHCI. ></note> > ><pre caption="Configuring your kernel"> ># <i>nano /usr/src/linux/.config</i> >MSDOS_FS=y >VFAT_FS=y >BLK_DEV_SD=y >CHR_DEV_ST=y >CHR_DEV_SG=y >USB_STORAGE=y >USB_UHCI_HCD=y >USB_OHCI_HCD=n ></pre> > ><p> >Now compile and install your kernel, when that finishes, reboot your system. ></p> > ></body> ></section> ><section> ><title>Making sure that hotplug detects your devices</title> ><body> > ><pre caption="Check dmesg"> ># <i>dmesg | grep usb-storage</i> ></pre> > ><pre caption="Modprobe your device if unloaded"> >usb.c: USB device 4 (vend/prod 0xdda/0x2005) is not claimed by any active >driver. ></pre> > ><note> >If this happens, it means you did not configure your kernel as it should have >been configured - you should return to <uri link="#doc_chap2_sect2">Configuring >the kernel</uri>. ></note> > ><p> >You can do this automatically by putting your driver name in ><path>/etc/modules.autoload.d/kernel-2.{4|6}</path>. ></p> > ><pre caption="For scsi interface"> ><comment>Utilities for querying the sg SCSI interface (contains rescan_scsi_bus.sh)</comment> ># <i>emerge sg3_utils</i> ></pre> > ></body> ></section> > ><section><title>mounting the USB drive</title> ><body> > ><p> >After that emerge completes, you should be able to mount the drive: ></p> > ><pre caption="Mounting the drive"> ># <i>mkdir /mnt/usbstick</i> ># <i>mount -t vfat /dev/sda1 /mnt/usbstick</i> ></pre> > ></body> ></section> > ><section><title>mounting firewire devices</title> ><body> > ><p> >You can use sg3_utils to scan for firewire devices as such: ></p> > ><pre caption="Looking for firewire devices"> ># <i>sg_scan -i</i> ># <i>sg_map</i> ></pre> > ></body> ></section> ></chapter> > ><chapter> ><title>Editing your fstab</title> ><section> ><title>Mounting your external usb-devices</title> ><body> > ><pre caption="/etc/fstab"> ># MY USB STICK >/dev/sda1 /mnt/stick vfat noauto,user,exec,sync 0 0 ></pre> > ><p> >Please note that you should use vfat in the fstab file, because if you choose ><c>auto</c>, you won't get the full name but only the first 8 characters. >Add the option <c>sync</c> to have synchronize changes between the usb mass >storage device itself, and the place that it's been mounted. Otherwise it would >be done while you unmount it. This is advantageous, because otherwise, you risk >losing data if you forgot to unmount the device in question, it also speeds up >unmount times. You don't need to use vfat in the fstab file as long as ><path>/etc/filesystems</path> is set up properly. ></p> > ><p> >If vfat exists in <path>/etc/filesystems</path> before any other fat >filesystems, 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. ></p> > ><pre caption="/etc/filesystems"> ># ># This file defines the filesystems search order used by a ># 'mount -t auto' command. ># ># Uncomment the following line if your modular kernel has vfat ># support and you want mount to try vfat. >vfat ># Uncomment the following line if your modular kernel has udf ># support and you want mount to try udf before iso9660. >udf ># Keep the last '*' intact as it directs mount to use the ># filesystems list available at /proc/filesystems also. ># Don't remove it unless you REALLY know what you are doing! ></pre> > ></body> ></section> > ><section><title>Managing your IPOD</title> ><body> > > ><p> >To be able to access the contents of an iPod correctly, you will need to install ><c>gtk-pod</c>. ></p> > ><pre caption="Installing gtk-pod"> ># <i>emerge gtk-pod</i> ></pre> > ></body> ></section> ></chapter> > ><chapter> ><title>Mounting your Windows partitions</title> ><section> ><title>The different filesystem types</title> ><body> > ><pre caption="mount -t type device mountpoint"> ># <i>mount -t ntfs /dev/hda1 /mnt/win</i> ># <i>mount -t vfat /dev/hda2 /mnt/data</i> ></pre> > ></body> ></section> ><section> ><title>user permissions</title> ><body> > ><p> >With all three filesystems (MS-DOS, VFAT, NTFS), mount lets you pass the uid >and gid options, which allow you set the user and group IDs of those who the >files are chown'd to when the filesystem is mounted. To find out the values for >uid and gid, you can run <c>id $user</c>. ></p> > ><p> ><c>umask</c>: Octal file permissions<br /> >You can change permissions using the parameter umask. However, please be aware >that it must be the bitmask of permissions which are not present for the >mountpoint. It is an octal number, formed like this: ></p> > ><ul> > <li> > Character '0': Indicates that this is an octal number, not decimal > </li> > <li>First digit: owner user permissions</li> > <li>Second digit: owner group permissions</li> > <li> > Third digit: world permissions (every other user on the system). > </li> ></ul> > ><table> > <tr> > <th colspan="4">Table 3.1: Permissions table</th> > </tr> > <tr> > <ti>M</ti> > <ti>R</ti> > <ti>W</ti> > <ti>X</ti> > </tr> > <tr> > <ti>0</ti> > <ti>*</ti> > <ti>*</ti> > <ti>*</ti> > </tr> > <tr> > <ti>1</ti> > <ti>*</ti> > <ti>*</ti> > <ti>-</ti> > </tr> > <tr> > <ti>2</ti> > <ti>*</ti> > <ti>-</ti> > <ti>*</ti> > </tr> > <tr> > <ti>3</ti> > <ti>*</ti> > <ti>-</ti> > <ti>-</ti> > </tr> > <tr> > <ti>4</ti> > <ti>-</ti> > <ti>*</ti> > <ti>*</ti> > </tr> > <tr> > <ti>5</ti> > <ti>-</ti> > <ti>*</ti> > <ti>-</ti> > </tr> > <tr> > <ti>6</ti> > <ti>-</ti> > <ti>-</ti> > <ti>*</ti> > </tr> > <tr> > <ti>7</ti> > <ti>-</ti> > <ti>-</ti> > <ti>-</ti> > </tr> ></table> > ><pre caption="/etc/fstab"> ># my windows partition >/dev/hda1 /mnt/ntfs ntfs uid=1000,gid=100 0 0 ></pre> > ><p> ><b>UTF-8</b><br /> >You may also add utf8 option, normally, this is only the case if you can't see >some files with international characters in filenames. ></p> > ><pre caption="/etc/fstab"> >/etc/fstab /dev/hda1 /mnt/vfat vfat ro,utf8 0 0 ></pre> > ><p> >For more options: ></p> > ><pre caption="See more?"> ># <i>man mount 8</i> ></pre> > ></body> ></section> ><section> ><title>Captive NTFS</title> ><body> > ><note> >You will need an X window system for <c>captive</c>. ></note> > ><p> >We need <c>sys-fs/captive</c> (Description: Captive uses binary Windows drivers >for full NTFS r/w access.) to get this to work. For now Captive is masked, and >as such, you will need to unmask it first: ></p> > ><p> >Emerge captive: ></p> > ><pre caption="emerge captive"> ># <i>emerge captive</i> ></pre> > ><p> >Now load the appropriate kernel module, and make it load at boot. ></p> > ><pre caption="Loading the appropriate kernel module"> ># <i>modules-update</i> ># <i>modprobe fuse</i> ># <i>echo "fuse" >> /etc/modules.autoload.d/kernel-2.6</i> ></pre> > ><p> >Congratulations; Captive should now be installed. To acquire the necessary >filesystems drivers you should run the following command to locate your ntfs >drives in a wizard. You should choose to download the appropriate drivers from ><uri>http://microsoft.com</uri> (You will need a Windows SP2 license to do this >legally.) (It doesn't matter if your partitions are mounted or not - the >program itself looks for the right partitions.) ></p> > ><pre caption="Acquiring the necessary filesystems"> ># <i>captive-install-acquire</i> ></pre> > ><p> >After you walked through the wizard, you should now be able to mount your >windows partitions read/write. ></p> > ><pre caption="remount your windows partitions"> ># <i>umount /mnt/win</i> ># <i>mount -t captive-ntfs /dev/hda1 /mnt/win</i> ></pre> > ><p> >If the following works without errors you may want to put it in your ><path>/etc/fstab</path> ></p> > ><pre caption="/etc/fstab"> >/dev/hda2 /windows captive-ntfs users 0 0 ></pre> > ><impo> >You will need to recompile fuse if you update your kernel! ></impo> > ><pre caption="After kernel update"> ># <i>modprobe -r fuse</i> ># <i>emerge sys-fs/fuse</i> ># <i>modules-update</i> ># <i>modprobe fuse</i> ></pre> > ></body> ></section> ></chapter> > ><chapter> ><title>Troubleshooting</title> ><section> ><title>Devices don't get recognized when inserted</title> ><body> > ><p> >This is probably due to udev not working. One of the reasons this could be >happening is becse udev needs specific kernel options to be turned on. The >basic options needed by <c>udev</c> for <c>kernel 2.6.16</c> and earlier are ><c>CONFIG_NET</c>, <c>CONFIG_HOTPLUG</c> and ><c>CONFIG_UEVENT</c> and the basic options needed by udev for ><c>kernel 2.6.17</c> and later are <c>CONFIG_NET</c>, ><c>CONFIG_HOTPLUG</c> as <c>CONFIG_UEVENT</c> has been >deprecated in favour of <c>CONFIG_NET</c> ></p> > ><note> >These basic options should be turned on by default. If someone turns them off >they should already know the consequences. ></note> > ><p> >Enable <c>KOBJECT_UEVENT</c> and <c>CONFIG_HOTPLUG</c> in your kernel. Search >for the following options with <c>/</c>, or edit ><path>/usr/src/linux/.config</path> to include them. ></p> > ><pre caption="/usr/src/linux/.config"> ><var>KOBJECT_UEVENT=y</var> ><var>CONFIG_HOTPLUG=y</var> ></pre> > ></body> ></section> ></chapter> ></guide> >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 111551
:
86657
|
86658
|
86660
|
86661
|
86662
|
86663
|
86664
|
86665
|
86671
|
86672
|
86673
|
91810
|
91823
|
91834
|
91841
|
92348
|
92655
|
92656
|
92708
|
92712