ImageVerifierCode 换一换
格式:DOC , 页数:5 ,大小:38.50KB ,
资源ID:3180422      下载积分:20 文钱
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,省得不是一点点
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.wenke99.com/d-3180422.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Linux根文件系统.doc)为本站会员(11****ws)主动上传,文客久久仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知文客久久(发送邮件至hr@wenke99.com或直接QQ联系客服),我们立即给予删除!

Linux根文件系统.doc

1、Linux 根文件系统( “/”文件系统)下的目录介绍本篇文章来源于 Linux 公社网站() 原文链接:http:/ 下的文件存储与 Windows 完全不同,Windows 将系统文件存储在系统盘(比如说 C:下)Linux 根本没有盘符到概念只有一个根文件系/,各个磁盘分本篇文章来源于 Linux 公社网站() 原文链接:http:/ 区挂载在/media/下(或者/mnt/下)/下到如/etc,/proc,/bin,/dev,lib 等很是让用惯了 Windows 的用户不解,下面是从 Linux.org 中找到到比较权威的说明。4.3.1. /devA /dev directory

2、containing a special file for all devices to be used by the system is mandatory for any Linux system. The directory itself is a normal directory, and can be created with mkdir in the normal way. The device special files, however, must be created in a special way, using the mknod command.There is a s

3、hortcut, though copy devices files from your existing hard disk /dev directory. The only requirement is that you copy the device special files using -R option. This will copy the directory without attempting to copy the contents of the files. Be sure to use an upper case R. For example: cp -dpR /dev

4、/fd01* /mnt/devcp -dpR /dev/tty0-6 /mnt/devassuming that the diskette is mounted at /mnt. The dp switches ensure that symbolic links are copied as links, rather than using the target file, and that the original file attributes are preserved, thus preserving ownership information.If you want to do it

5、 the hard way, use ls -l to display the major and minor device numbers for the devices you want, and create them on the diskette using mknod.However the devices files are created, check that any special devices you need have been placed on the rescue diskette. For example, ftape uses tape devices, s

6、o you will need to copy all of these if you intend to access your floppy tape drive from the bootdisk. Note that one inode is required for each device special file, and inodes can at times be a scarce resource, especially on diskette filesystems. Youll need to be selective about the device files you

7、 include. For example, if you do not have SCSI disks you can safely ignore /dev/sd*; if you dont intend to use serial ports you can ignore /dev/ttyS*. If, in building your root filesystem, you get the error No space left on device but a df command shows space still available, you have probably run o

8、ut of inodes. A df -i will display inode usage.Be sure to include the following files from this directory: console, kmem, mem, null, ram0 and tty1.4.3.2. /etcThe /etc directory contains configuration files. What it should contain depends on what programs you intend to run. On most systems, these can

9、 be divided into three groups: Required at all times, e.g. rc, fstab, passwd.May be required, but no one is too sure.Junk that crept in. Files which are not essential can usually be identified with the command: ls -ltruThis lists files in reverse order of date last accessed, so if any files are not

10、being accessed, they can be omitted from a root diskette. On my root diskettes, I have the number of config files down to 15. This reduces my work to dealing with three sets of files: The ones I must configure for a boot/root system: rc.d/* - system startup and run level change scriptsfstab - list o

11、f file systems to be mounted inittab - parameters for the init process, the first process started at boot time.gettydefs - parameters for the init process, the first process started at boot time.The ones I should tidy up for a boot/root system: passwd - Critical list of users, home directories, etc.

12、group - user groups. shadow - passwords of users. You may not have this. termcap - the terminal capability database.If security is important, passwd and shadow should be pruned to avoid copying user passwords off the system, and so that unwanted logins are rejected when you boot from diskette.Be sur

13、e that passwd contains at least root. If you intend other users to login, be sure their home directories and shells exist.termcap, the terminal database, is typically several hundred kilobytes. The version on your boot/root diskette should be pruned down to contain only the terminal(s) you use, whic

14、h is usually just the Linux or Linux-console entry.The rest. They work at the moment, so I leave them alone.Out of this, I only really have to configure two files, and what they should contain is surprisingly small. rc should contain: #!/bin/sh /bin/mount -av/bin/hostname KangarooBe sure it is execu

15、table, be sure it has a “#!“ line at the top, and be sure any absolute filenames are correct. You dont really need to run hostname it just looks nicer if you do. fstab should contain at least: /dev/ram0 / ext2 defaults/dev/fd0 / ext2 defaults/proc /proc proc defaultsYou can copy entries from your ex

16、isting fstab, but you should not automatically mount any of your hard disk partitions; use the noauto keyword with them. Your hard disk may be damaged or dead when the bootdisk is used.Your inittab should be changed so that its sysinit line runs rc or whatever basic boot script will be used. Also, i

17、f you want to ensure that users on serial ports cannot login, comment out all the entries for getty which include a ttys or ttyS device at the end of the line. Leave in the tty ports so that you can login at the console.A minimal inittab file looks like this: id:2:initdefault:si:sysinit:/etc/rc1:234

18、5:respawn:/sbin/getty 9600 tty12:23:respawn:/sbin/getty 9600 tty2The inittab file defines what the system will run in various states including startup, move to multi-user mode, etc. Check carefully the filenames mentioned in inittab; if init cannot find the program mentioned the bootdisk will hang,

19、and you may not even get an error message.Note that some programs cannot be moved elsewhere because other programs have hardcoded their locations. For example, on my system, /etc/shutdown has hardcoded in it /etc/reboot. If I move reboot to /bin/reboot, and then issue a shutdown command, it will fai

20、l because it cannot find the reboot file.For the rest, just copy all the text files in your /etc directory, plus all the executables in your /etc directory that you cannot be sure you do not need. As a guide, consult the sample listing in Appendix C. Probably it will suffice to copy only those files

21、, but systems differ a great deal, so you cannot be sure that the same set of files on your system is equivalent to the files in the list. The only sure method is to start with inittab and work out what is required.Most systems now use an /etc/rc.d/ directory containing shell scripts for different r

22、un levels. The minimum is a single rc script, but it may be simpler just to copy inittab and the /etc/rc.d directory from your existing system, and prune the shell scripts in the rc.d directory to remove processing not relevent to a diskette system environment.4.3.3. /bin and /sbinThe /bin directory

23、 is a convenient place for extra utilities you need to perform basic operations, utilities such as ls, mv, cat and dd. See Appendix C for an example list of files that go in a /bin and /sbin directories. It does not include any of the utilities required to restore from backup, such as cpio, tar and

24、gzip. That is because I place these on a separate utility diskette, to save space on the boot/root diskette. Once the boot/root diskette is booted, it is copied to the ramdisk leaving the diskette drive free to mount another diskette, the utility diskette. I usually mount this as /usr.Creation of a

25、utility diskette is described below in Section 9.2. It is probably desirable to maintain a copy of the same version of backup utilities used to write the backups so you dont waste time trying to install versions that cannot read your backup tapes.Be sure to include the following programs: init, gett

26、y or equivalent, login, mount, some shell capable of running your rc scripts, a link from sh to the shell.4.3.4. /libIn /lib you place necessary shared libraries and loaders. If the necessary libraries are not found in your /lib directory then the system will be unable to boot. If youre lucky you ma

27、y see an error message telling you why.Nearly every program requires at least the libc library, libc.so.N, where N is the current version number. Check your /lib directory. The file libc.so.N is usually a symlink to a filename with a complete version number:% ls -l /lib/libc*-rwxr-xr-x 1 root root 4

28、016683 Apr 16 18:48 libc-2.1.1.so*lrwxrwxrwx 1 root root 13 Apr 10 12:25 libc.so.6 - libc-2.1.1.so*In this case, you want libc-2.1.1.so. To find other libraries you should go through all the binaries you plan to include and check their dependencies with ldd. For example: % ldd /sbin/mke2fslibext2fs.

29、so.2 = /lib/libext2fs.so.2 (0x40014000)libcom_err.so.2 = /lib/libcom_err.so.2 (0x40026000)libuuid.so.1 = /lib/libuuid.so.1 (0x40028000)libc.so.6 = /lib/libc.so.6 (0x4002c000)/lib/ld-Linux.so.2 = /lib/ld-Linux.so.2 (0x40000000)Each file on the right-hand side is required. The file may be a symbolic l

30、ink.Note that some libraries are quite large and will not fit easily on your root filesystem. For example, the libc.so listed above is about 4 meg. You will probably need to strip libraries when copying them to your root filesystem. See Section 8 for instructions.In /lib you must also include a load

31、er for the libraries. The loader will be either ld.so (for A.OUT libraries, which are no longer common) or ld-Linux.so (for ELF libraries). Newer versions of ldd tell you exactly which loader is needed, as in the example above, but older versions may not. If youre unsure which you need, run the file

32、 command on the library. For example: % file /lib/libc.so.4.7.2 /lib/libc.so.5.4.33 /lib/libc-2.1.1.so/lib/libc.so.4.7.2: Linux/i386 demand-paged executable (QMAGIC), stripped/lib/libc.so.5.4.33: ELF 32-bit LSB shared object, Intel 80386, version 1, stripped/lib/libc-2.1.1.so: ELF 32-bit LSB shared

33、object, Intel 80386, version 1, not strippedThe QMAGIC indicates that 4.7.2 is for A.OUT libraries, and ELF indicates that 5.4.33 and 2.1.1 are for ELF. Copy the specific loader(s) you need to the root filesystem youre building. Libraries and loaders should be checked carefully against the included binaries. If the kernel cannot load a necessary library, the kernel may hang with no error message.本篇文章来源于 Linux 公社网站() 原文链接:http:/

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。