韦东山视频总结之NFS挂载文件系统.docx

上传人:b****1 文档编号:2451761 上传时间:2023-05-03 格式:DOCX 页数:15 大小:337.16KB
下载 相关 举报
韦东山视频总结之NFS挂载文件系统.docx_第1页
第1页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第2页
第2页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第3页
第3页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第4页
第4页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第5页
第5页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第6页
第6页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第7页
第7页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第8页
第8页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第9页
第9页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第10页
第10页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第11页
第11页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第12页
第12页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第13页
第13页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第14页
第14页 / 共15页
韦东山视频总结之NFS挂载文件系统.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

韦东山视频总结之NFS挂载文件系统.docx

《韦东山视频总结之NFS挂载文件系统.docx》由会员分享,可在线阅读,更多相关《韦东山视频总结之NFS挂载文件系统.docx(15页珍藏版)》请在冰点文库上搜索。

韦东山视频总结之NFS挂载文件系统.docx

韦东山视频总结之NFS挂载文件系统

学习韦东山嵌入式linux完全开发手册视频11课4小节的笔记

整理人:

KPBoyqq:

1056339680

韦东山二期驱动视频教程秒杀价格180元应该是市面上最好的嵌入式学习视频报名只要给我淘宝号和名字就可以了到时自己到他的淘宝店拍下视频的

这里是视频的详细网页介绍

开发环境:

装有红帽企业版6.2的wmware虚拟机一台

交叉工具链是:

嵌入式光盘里附送的交叉工具链arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2

Uboot:

1.1.6

Linuxkernel:

linux-2.6.22.6

Filesystem:

使用mdev机制的最小根文件系统fs_mini_mdev

还有一个需要注意的地方:

光盘里的linux-2.6.22.6在TQ2440/MINI2440上使用时会导致蜂鸣器响,这是因为JZ2440的LCD用GPB0作为LCD背光使能引脚,而TQ2440/MINI2440用GPB0作为蜂鸣器的使能引脚

使用TQ2440/MINI2440时,重新配置内核把自带的LCD驱动去掉即可,方法如下:

在内核目录下执行:

makemenuconfig

->DeviceDrivers

->Graphicssupport

<>S3C2410LCDframebuffersupport//输入N

(以上都是使用韦东山老师提供的源码和补丁,现在先熟悉下,等以后自己熟悉了再自己来移植和完善)

S3C2440开发板一台

好了,根据韦东山前面的9到11课的视频,搭建好上面的uboot和内核之后,我们就开始搭建在产品开发过程中经常使用到的NFS文件系统了。

首先我们来看看Linux文件系统时什么?

问:

什么是Linux文件系统?

答:

通常一个完整的Linux系统有数千上万个文件组成,文件中存储了程序,数据和各种信息。

层次化的目录结构对于文件进行编目和分组。

期中采用了各种方法来永久存储所需的结构和数据。

为支持各种本机文件系统,而同时允许访问其他操作系统的文件,Linux内核在用户进程(或C标准库)和文件系统实现之间引入了一个抽象层。

该抽象层称之为虚拟文件系统(VirtualFilesystem),简称VFS。

VFS的任务并不简单。

一方面。

它用来提供操作文件,目录及其他对象的统一方法。

另一方面都有一些不同之处。

但VFS的回报很高,它使得Linux更加灵活了。

内核支持40多种文件系统,其来源各种各样:

如用于CD-ROM的iso9660,网络文件系统(NFS文件系统)和虚拟的文件系统(如proc文件系统)。

问:

那么linux文件系统有哪些类型呢?

文件系统一般可以分为下面3中。

(我们这里是详细学习下网络文件系统)

①基于磁盘的文件系统

②虚拟文件系统(virtualFilesystem),如proc文件系统

③网络文件系统(NetworkFilesystem):

是基于磁盘的文件系统和虚拟文件系统之间的折中。

这种文件系统允许访问另一台计算机上的数据,该计算机通过网络连接到本地计算机。

在这种情况下,数据实际上是存储在一个不同系统的硬件设备上。

这意味着内核无需关注文件的存取,数据的组织和硬件通信的细节,这些有远程计算机的内核处理。

对这类文件系统中的文件操作都是通过网络连接进行。

在进程向文件写入数据时,数据使用特定的协议(由具体的网络文件系统决定)发送到远程计算机。

接下来远程计算机负责储存传输的数据并通知发送者数据已经到达。

尽管是这样,但是内核处理网络文件系统时,依然需要文件长度,文件在目录层次中的位置以及文件的其他重要信息。

他必须在提供函数,使得用户进程能够执行通常的文件相关操作,如打开,读,删除等。

由于VFS抽象层的存在,用户空间的进程不会看到本地系统与网络文件系统之间的区别。

NFS文件系统的详细使用说明可以参考:

linux-2.6.6.22code\linux-2.6.22.6\Documentation\nfsroot.txt(以下是这个文档的内容)

MountingtherootfilesystemviaNFS(nfsroot)

===============================================

Written1996byGeroKuhlmann

Updated1997byMartinMares

Updated2006byNicoSchottelius

Updated2006byHorms

 

Inordertouseadisklesssystem,suchasanX-terminalorprinterserver

forexample,itisnecessaryfortherootfilesystemtobepresentona

non-diskdevice.Thismaybeaninitramfs(seeDocumentation/filesystems/

ramfs-rootfs-initramfs.txt),aramdisk(seeDocumentation/initrd.txt)ora

filesystemmountedviaNFS.ThefollowingtextdescribesonhowtouseNFS

fortherootfilesystem.Fortherestofthistext'client'meansthe

disklesssystem,and'server'meanstheNFSserver.

 

1.)Enablingnfsrootcapabilities

-----------------------------

Inordertousenfsroot,NFSclientsupportneedstobeselectedas

built-induringconfiguration.Oncethishasbeenselected,thenfsroot

optionwillbecomeavailable,whichshouldalsobeselected.

Inthenetworkingoptions,kernellevelautoconfigurationcanbeselected,

alongwiththetypesofautoconfigurationtosupport.Selectingallof

DHCP,BOOTPandRARPissafe.

 

2.)Kernelcommandline

-------------------

Whenthekernelhasbeenloadedbyabootloader(seebelow)itneedstobe

toldwhatrootfsdevicetouse.Andinthecaseofnfsroot,wheretofind

boththeserverandthenameofthedirectoryontheservertomountasroot.

Thiscanbeestablishedusingthefollowingkernelcommandlineparameters:

 

root=/dev/nfs

Thisisnecessarytoenablethepseudo-NFS-device.Notethatit'snota

realdevicebutjustasynonymtotellthekerneltouseNFSinsteadof

arealdevice.

 

nfsroot=[:

][,]

Ifthe`nfsroot'parameterisNOTgivenonthecommandline,

thedefault"/tftpboot/%s"willbeused.

SpecifiestheIPaddressoftheNFSserver.

Thedefaultaddressisdeterminedbythe`ip'parameter

(seebelow).Thisparameterallowstheuseofdifferent

serversforIPautoconfigurationandNFS.

Nameofthedirectoryontheservertomountasroot.

Ifthereisa"%s"tokeninthestring,itwillbe

replacedbytheASCII-representationoftheclient's

IPaddress.

StandardNFSoptions.Alloptionsareseparatedbycommas.

Thefollowingdefaultsareused:

port=asgivenbyserverportmapdaemon

rsize=4096

wsize=4096

timeo=7

retrans=3

acregmin=3

acregmax=60

acdirmin=30

acdirmax=60

flags=hard,nointr,noposix,cto,ac

 

ip=:

:

:

:

:

:

ThisparametertellsthekernelhowtoconfigureIPaddressesofdevices

andalsohowtosetuptheIProutingtable.Itwasoriginallycalled

`nfsaddrs',butnowtheboot-timeIPconfigurationworksindependentlyof

NFS,soitwasrenamedto`ip'andtheoldnameremainedasanaliasfor

compatibilityreasons.

Ifthisparameterismissingfromthekernelcommandline,allfieldsare

assumedtobeempty,andthedefaultsmentionedbelowapply.Ingeneral

thismeansthatthekerneltriestoconfigureeverythingusing

autoconfiguration.

Theparametercanappearaloneasthevaluetothe`ip'

parameter(withoutallthe':

'charactersbefore)inwhichcaseauto-

configurationisused.

IPaddressoftheclient.

Default:

Determinedusingautoconfiguration.

IPaddressoftheNFSserver.IfRARPisusedtodetermine

theclientaddressandthisparameterisNOTemptyonly

repliesfromthespecifiedserverareaccepted.

OnlyrequiredforforNFSroot.Thatisautoconfiguration

willnotbetriggeredifitismissingandNFSrootisnot

inoperation.

Default:

Determinedusingautoconfiguration.

Theaddressoftheautoconfigurationserverisused.

IPaddressofagatewayiftheserverisonadifferentsubnet.

Default:

Determinedusingautoconfiguration.

Netmaskforlocalnetworkinterface.Ifunspecified

thenetmaskisderivedfromtheclientIPaddressassuming

classfuladdressing.

Default:

Determinedusingautoconfiguration.

Nameoftheclient.Maybesuppliedbyautoconfiguration,

butitsabsencewillnottriggerautoconfiguration.

Default:

ClientIPaddressisusedinASCIInotation.

Nameofnetworkdevicetouse.

Default:

Ifthehostonlyhasonedevice,itisused.

Otherwisethedeviceisdeterminedusing

autoconfiguration.Thisisdonebysending

autoconfigurationrequestsoutofalldevices,

andusingthedevicethatreceivedthefirstreply.

Methodtouseforautoconfiguration.Inthecaseofoptions

whichspecifymultipleautoconfigurationprotocols,

requestsaresentusingallprotocols,andthefirstone

toreplyisused.

Onlyautoconfigurationprotocolsthathavebeencompiled

intothekernelwillbeused,regardlessofthevalueof

thisoption.

offornone:

don'tuseautoconfiguration(default)

onorany:

useanyprotocolavailableinthekernel

dhcp:

useDHCP

bootp:

useBOOTP

rarp:

useRARP

both:

usebothBOOTPandRARPbutnotDHCP

(oldoptionkeptforbackwardscompatibility)

Default:

any

 

3.)BootLoader

----------

Togetthekernelintomemorydifferentapproachescanbeused.

Theydependonvariousfacilitiesbeingavailable:

 

3.1)Bootingfromafloppyusingsyslinux

Whenbuildingkernels,aneasywaytocreateabootfloppythatuses

syslinuxistousethezdiskorbzdiskmaketargetswhichuse

andbzimageimagesrespectively.Bothtargetsacceptthe

FDARGSparameterwhichcanbeusedtosetthekernelcommandline.

e.g.

makebzdiskFDARGS="root=/dev/nfs"

Notethattheuserrunningthiscommandwillneedtohave

accesstothefloppydrivedevice,/dev/fd0

Formoreinformationonsyslinux,includinghowtocreatebootdisks

forprebuiltkernels,see

N.B:

Previouslyitwaspossibletowriteakerneldirectlyto

afloppyusingdd,configurethebootdeviceusingrdev,and

bootusingtheresultingfloppy.Linuxnolongersupportsthis

methodofbooting.

3.2)Bootingfromacdromusingisolinux

Whenbuildingkernels,aneasywaytocreateabootablecdromthat

usesisolinuxistousetheisoimagetargetwhichusesabzimage

image.Likezdiskandbzdisk,thistargetacceptstheFDARGS

parameterwhichcanbeusedtosetthekernelcommandline.

e.g.

makeisoimageFDARGS="root=/dev/nfs"

Theresultingisoimagewillbearch//boot/image.iso

Thiscanbewrittentoacdromusingavarietyoftoolsincluding

cdrecord.

e.g.

cdrecorddev=ATAPI:

1,0,0arch/i386/boot/image.iso

Formoreinformationonisolinux,includinghowtocreatebootdisks

forprebuiltkernels,see

3.2)UsingLILO

WhenusingLILOallthenecessarycommandlineparametersmaybe

specifiedusingthe'append='directiveintheLILOconfiguration

file.

However,tousethe'root='directiveyoualsoneedtocreate

adummyrootdevice,whichmayberemovedafterLILOisrun.

mknod/dev/boot255c0255

ForinformationonconfiguringLILO,pleaserefertoitsdocumentation.

3.3)UsingGRUB

WhenusingGRUB,kernelparameteraresimplyappendedafterthekernel

specification:

kernel

3.4)Usingloadlin

loadlinmaybeusedtobootLinuxfromaDOScommandpromptwithout

requiringalocalharddisktomountasroot.Thishasnotbeen

thoroughlytestedbytheauthorsofthisdocument,butingeneral

itshouldbepossibleconfigurethekernelcommandlinesimilarly

totheconfigurationofLILO.

Pleaserefertotheloadlindocumentationforfurtherinformation.

3.5)UsingabootROM

Thisisprobablythemostelegantwayofbootingadisklessclient.

WithabootROMthekernelisloadedusingtheTFTPprotocol.The

authorsofthisdo

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 求职职场 > 简历

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2