Fedora4.0HAL configuration out-of-the-box mobile storage practices

Source: Internet
Author: User
Article Title: Fedora4.0HAL configuration plug-and-play mobile storage practices. Linux is a technology channel of the IT lab in China. Some basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open-source systems. Due to my Fixed Thinking and insufficient acceptance of new things, I always use old thinking to learn Fedora Core 4.0; for mobile storage, such as USB flash drives, mobile hard drives, and digital cameras, most plug-and-play applications can be used in Linux; only a few cannot; for example, a 6-in-1 card reader integrated with a notebook (many of which are not supported or supported );

I rarely use Fedora. I feel that Fedora is a lab and new features will appear in Fedora. This enhances the ease of use of the Linux Desktop edition. In fact, this is also a good thing;

For the principle of plug-and-play USB storage, bbbush has already discussed in linux.chinaitlab.com/driver/40018.html "> set the storage-policy of fc3 HAL to automatically mount the vfat partition on the USB disk. You can take a look at this article. After reading this article, the idea will be much clearer. After reading this article, the skill will grow too long ;:)

HAL-Hardware action Layer (Hardware extraction Layer). I do not know how to translate it. In my understanding, it is similar to Windows Hardware Management;

The article I wrote is actually useless. Why? Because there is no technical content, it is only written to solve the problem, there is no principle, just a few lines or a few lines of words; it may be useful for beginners;

1. USB mobile storage;

Digital camera, MMC card, SD card, usb mini disk, USB mobile hard disk (there is a USB interface box with a laptop hard disk and a large computer hard disk ), 1394 mobile storage of interfaces, recording pen, DV, etc., mostly use mobile storage;

2. Support for fat, ntfs, fat32, reiserfs, ext3, and hfs file systems;

Fedora core 4.0 supports almost all file systems, so there is no need to compile the kernel. If you have a mobile hard disk that is partitioned by NTFS like me, Please install the support of the kernel NTFS module;

The kernel already supports the fat format, both of which are supported by fat16 fat32. For the NTFS format file system, install the NTFS kernel-moduls. I feel like NTFS is moving disk partitions, it doesn't make much sense (but I have a mobile hard disk and a partition is ntfs), because NTFS is not writable; so use fat or fat32;

If your machine has a 1394 Interface, if you want to purchase a large storage device, we recommend that you still buy a 1394 Interface Box. USB does not support writing large files, no matter what the file system is (speaking in fact, I have tried it); in addition, hard disks with 1394 interfaces can be stably loaded during system startup;

3. plug-and-play: the system automatically mounts mobile storage devices;

1. First, make sure that the following services are enabled;

[Root @ localhost beinan] # chkconfig -- list | grep haldaemonhaldaemon 0: Enable 1: Enable 2: Enable 3: Enable 4: Enable 5: Enable 6: enable [root @ localhost beinan] # chkconfig -- list | grep messagebusmessagebus 0: Enable 1: Enable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable

If it is not enabled in 3 and 5 modes, you must enable it;

[root@localhost beinan]# chkconfig --level 0123456  haldaemon  on[root@localhost beinan]# chkconfig --level 0123456   messagebus  on

Open all modes; check whether the services we mentioned are running in all modes; Use the chkconfig -- list | grep server name mentioned above;
After doing so, the services we mentioned will automatically run in all modes upon startup; we do not need to interfere with them manually; however, sometimes we have to enable and disable them ourselves for debugging; see the next section;

2. Services Running in standalone mode are mostly in the/etc/init. d directory;

Usage:

/Etc/initrd server start | stop | status | restart | condrestart

Example:

For example, if we want to enable the haldaemon Server:

[Root @ localhost beinan] #/etc/init. d/haldaemon start the HAL daemon process: [OK] [root @ localhost beinan] #/etc/init. d/haldaemon restart is shutting down the HAL daemon: [OK] Starting the HAL daemon: [OK] [root @ localhost beinan] #/etc/init. d/haldaemon stop is shutting down the HAL daemon: [OK] [root @ localhost beinan] #/etc/init. d/haldaemon statushald stopped

This beginner knows all about it, including start, restart, stop, and status;

The three servers we mentioned in this article are all in the/etc/init. d directory;

3. If the above steps can be completed, most mobile storage devices are plug-and-play and automatically mounted;

Although the system is plug-and-play, the permission may not meet our needs. In addition, if the text is stored in the fat and ntfs file systems, the Chinese support for file names is unfriendly; so ...... solution .....

4. solve the problem that the vfat and ntfs file systems normally display Chinese file names and file permissions;

1. Confirm the locale of the system;

[beinan@localhost ~]$ localeLANG=zh_CN.UTF-8LC_CTYPE="zh_CN.UTF-8"LC_NUMERIC="zh_CN.UTF-8"LC_TIME="zh_CN.UTF-8"LC_COLLATE="zh_CN.UTF-8"LC_MONETARY="zh_CN.UTF-8"LC_MESSAGES="zh_CN.UTF-8"LC_PAPER="zh_CN.UTF-8"LC_NAME="zh_CN.UTF-8"LC_ADDRESS="zh_CN.UTF-8"LC_TELEPHONE="zh_CN.UTF-8"LC_MEASUREMENT="zh_CN.UTF-8"LC_IDENTIFICATION="zh_CN.UTF-8"LC_ALL=[beinan@localhost ~]$

If your system code is gb2312, gbk, or gb18030, do not change the locale. We just need to change the file of the hal server;

2. Modify the hal configuration file;

In Fedora 4.0, the hal server's mobile storage configuration file

/Usr/share/hal/fdi/policy/10 osvendor/10-storage-policy.fdi;

Back up data before making changes;

[root@localhost 10osvendor]# cp 10-storage-policy.fdi  10-storage-policy.fdiBAK

Open the 10-storage-policy.fdi file, and add the following two sections;




True
True
True
True
True






True
True
True
True
True



After the following section;

 

/Media
True
Managed
Kudzu
True
True
True


Note:If your system code is gb2312, gbk, gb18030, or other, change the utf8 in the two sections we added to cp936 or gb2312, it always works;

3. Restart the hal daemon;
[Root @ localhost beinan] #/etc/init. d/haldaemon restart
Closing HAL daemon: [OK]
Start the HAL daemon: [OK]

4. Plug in a USB or 1394 device. Click the computer on the desktop to view the disk icon;

Sometimes it may slow down, whether it is mounted, and where it is mounted, we can use df-lh to check;

[Root @ localhost beinan] # df-lhFilesystem capacity in use available % mount point/dev/hda8 11G 5.9G 4.5G 58%/dev/shm 236 M 0 236 M 0%/ dev/shm/dev/sdc5 5.2G 63 M 4.9G 2%/media/usbdisk2/dev/sdc1 4.2G 1.4G 2.8G 34%/media/usbdisk1/dev/sdb1 988 M 3.7 M 984 M 1%/media/usbdisk/dev/sda1 56G 22G 35G 39%/media/ieee1394disk

5. test whether the permission can be written by common users;

If the format is fat or fat32, we have defined the mount option in the file 10-storage-policy.fdi, such as user and rw, which are readable and writable;

If it is an ntfs partition, we set umask = 000 for the mount option, so that all users have the permissions, but the ntfs partition can only be readable in Linux; it doesn't make much sense;

For ext3, reiserfs, and ext2 file systems, if common users can read and write data, check the mount point and run the chmod-R 777 directory name; in this way, all users can read and write data.

Execute the Code. In addition, each user's files are independent of each other and are kept confidential. Chinese support does not have any problems. If garbled characters appear, you can use export LANG = to temporarily set the encoding. For example, export LANG = zh_CN

For other file formats, you must support the kernel. Most FC4 files are supported, such as the hfs file system;

5. Tips on hal configuration file Learning;

1. View/usr/share/doc/hal-0.5.2/conf

2. Check the hal package score and place it in the system. A prompt is also displayed;

[Root @ localhost beinan] # rpm-ql hal

3. Documents are in the directory of/usr/share/doc/hal-0.5.2/; examples of configuration files are available;

4. HAL-Hardware action Layer (Hardware extraction Layer ),

Is this a literal translation or a hardware abstraction layer? It seems like windows Hardware Management. We can view it through lshal | more;

[Root @ localhost beinan] # lshal | more

There is also a more intuitive tool; hal-gnome, which can be obtained through apt or yum; after installation, there is a more intuitive hal GUI;

[Root @ localhost beinan] # hal-device-manager

5. The hardware configuration of hal is flexible, and the syntax is relatively simple.

We should check the system devices based on lshal or hal-device-manager. hal can manage all the devices and the structure is clear. I also want to solve the problem, after reading man, I found hal. Later I found bbbush's post. I didn't find it through bbbush's post (a big essence), which wasted a lot of time ;:(

At present, I just plug in USB in practice. hal is used for 1394 mobile storage devices. More directly, I did some tests and practices to solve the problem. More I Don't Understand :(

If you want to specify a deviceStartingClose layer, similar to html syntax; Match If you want to set a more precise configuration, you should match the configuration multiple times; In this example, we put the actions on the line that the device refers to, for example, whether to load, if yes, true, whether the relationship is a logical relationship bool type; that is, 1 and 0, it can be obtained through lshal; in addition, string is a string, such as mout_root (mount point)/media, which can also be found in lshal; all the condition information can be obtained in lshal;

A condition row is a collection of actions that we want to perform without the system And Yes. We require more accurate system matching hardware. It should be an intersection. For example, for some devices, some parameters are the same. In this case, multiple matches are required, but the more accurate the better. For mobile storage, we can find the same information of all mobile storage. In this way, common devices can act;

I just want to talk a little bit about the principle. In fact, the default configuration file of the system can make our devices move; there is no need to change too much;

Postscript:Writing for new beginners; communicating with new siblings;

Refer:

1. linux.chinaitlab.com/driver/40018.html "> set storage-policy of fc3 HAL to automatically mount vfat partitions on the USB disk
2. HAL official site: http://freedesktop.org/Software/hal
4. man fsck-sync
5. man mount
6. http://www.ometer.com/hardware.html
7. http://vrfy.org/projects/hal/hal-spec.html

Introduction to Linux commands for viewing disk partitions, file systems, usage, and related tools
How to Use fdisk for instance explanation
Loading NTFS and FAT32 partitions in Fedora core 4.0
Rational Planning of your hard disk partition
System guiding process and hard disk partition structure
Fedora Core 4.0 HAL configuration plug-and-play mobile storage (USB and 1394) practices

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.