ºìÁªLinuxÃÅ»§
Linux°ïÖú

linux»·¾³ÏÂʹÓÃJFSÎļþϵͳ

·¢²¼Ê±¼ä:2005-12-14 09:34:18À´Ô´:ºìÁª×÷Õß:chentong
JFSÊÇIBM¹«Ë¾Îªlinuxϵͳ¿ª·¢µÄÒ»¸öÈÕÖ¾Îļþϵͳ¡£´ÓIBMµÄʵÁ¦¼°Ëü¶ÔLinuxµÄ̬¶ÈÀ´¿´£¬JFSÓ¦¸ÃÊÇδÀ´ÈÕÖ¾ÎļþϵͳÖÐ×î¾ßʵÁ¦µÄÒ»¸öÎļþϵͳ¡£

JFSÌṩÁË»ùÓÚÈÕÖ¾µÄ×Ö½Ú¼¶Îļþϵͳ£¬¸ÃÎļþϵͳÊÇΪÃæÏòÊÂÎñµÄ¸ßÐÔÄÜϵͳ¶ø¿ª·¢µÄ¡£JFS Äܹ»ÔÚ¼¸Ãë»ò¼¸ ·ÖÖÓÄھͰÑÎļþϵͳ»Ö¸´µ½Ò»ÖÂ״̬¡£JFSÄܹ»±£Ö¤Êý¾ÝÔÚÈκÎÒâÍâå´»úµÄÇé¿öÏ£¬²»»áÔì³É´ÅÅÌÊý¾ÝµÄ¶ªÊ§ÓëË𻵡£

Ò»¡¢JFSÎļþϵͳÌصã

1£®´æ´¢¿Õ¼ä¸ü´ó

JFS Ö§³ÖµÄ×îСÎļþϵͳÊÇ 16M ×Ö½Ú¡£×î´óÎļþϵͳµÄ´óСΪ 512 ÍòÒÚ×Ö½Ú£¨TB£©¡£JFS ÊÇÕæÕýÒâÒåÉ쵀 64 λµÄÎļþϵͳ¡£ËùÓÐ JFS Îļþϵͳ½á¹¹»¯×ֶζ¼ÊÇ 64 λ´óС¡£

2£®¶¯Ì¬´ÅÅÌ inode ·ÖÅä

JFS °´ÐèΪ´ÅÅÌ inode ¶¯Ì¬µØ·ÖÅä¿Õ¼ä£¬ÊͷŲ»ÔÙÐèÒªµÄ¿Õ¼ä¡£ÕâÖÖ·½Ê½±Ü¿ªÁËÔÚÎļþϵͳ´´½¨Æڼ䣬Ϊ´ÅÅÌ inode ±£Áô¹Ì¶¨ÊýÁ¿¿Õ¼äµÄ´«Í³·½·¨¡£Óû§²»ÐèÒª¿¼ÂÇÎļþϵͳ°üº¬µÄÎļþºÍĿ¼×î´óÊýÄ¿¡£

3£®»ùÓÚÅÌÇøµÄÑ°Ö·½á¹¹

JFS ʹÓûùÓÚÅÌÇøµÄÑ°Ö·½á¹¹£¬JFS ·ÖÅä³¢ÊÔͨ¹ý·ÖÅä×îСÊýÁ¿µÄÅÌÇø²ßÂÔ£¬¶øʹÿ¸öÅÌÇø¾¡¿ÉÄÜ´ó¡£ÕâÓÐÀûÓÚ´óµÄ I/O ´«ËÍ£¬´ÅÅ̶ÁдÐÔÄÜËùÓÐÌá¸ß¡£

4£®¿é³ß´ç¿É±ä

JFS Ö§³Ö 512¡¢1024¡¢2048 ºÍ 4096 ×ֽڵĿé³ß´ç£¬ÔÊÐíÓû§¸ù¾ÝÓ¦Óû·¾³ÓÅ»¯¿Õ¼äÀûÓÃÂÊ¡£½ÏСµÄ¿é³ß´ç¼õÉÙÓÐÀûÓÚÄÚ²¿´æ´¢ËéƬµÄÊýÁ¿£¬Ìá¸ß¿Õ¼äÀûÓÃÂÊ¡£ÏµÍ³È±Ê¡¿é³ß´çΪ 4096 ×Ö½Ú¡£

¶þ¡¢Ê¹ÓÃJFSÎļþϵͳ

1£®±àÒëÄÚºËÒÔÖ§³ÖJFSÎļþϵͳ

Ê×ÏÈÏÂÔØ×îеÄ2.4.x ºËÐÄ£¬ÏÂÔصØÖ·ftp://ftp.kernel.org/¡£È»ºóÏÂÔØJFSϵͳÈí¼þ°ü£ºhttp://www-124.ibm.com/developerworks/oss/jfs/£¬Ãû³ÆΪ£ºjfs-x.y.z-patch.tar.gz¡£ ½«ÏÂÔØÎļþ´æ·ÅÔÚ/usr/srcĿ¼ÖС£

ÔÚ/usr/src/Éϵ±Ä¿Â¼Ï½⿪jfsµÄÈí¼þ°ü

# tar -zxvf jfs-2.4-1.0.4.tar.gz

# tar -zxvf jfs-2.4-1.0.4-patch.tar.gz

µÃµ½ËĸöÎļþ£º

jfs-2.4.common-v1.0.4-patch

jfs-2.4.7-v1.0.4-patch

jfs-2.4.5-v1.0.4-patch

jfs-2.4.0-v1.0.4-patch

ÆäÖУ¬jfs-2.4.common-v1.0.4-patchÎļþÓÃÓÚËùÓеÄ2.4ºËÐÄ£¬jfs-2.4.0-v1.0.4-patchÓÃÓÚ2.4.0-2.4.2¡£jfs-2.4.5-v1.0.4-patch¿ÉÓÃÓÚºËÐÄ2.4.5¼°2.4.6¡£

×¢Òâ×ÐϸÔĶÁREADMEÎļþ£¬²»ÒªÓôíÁËpatchÎļþ

½Ó×ÅÊÇΪºËÐÄ´ò²¹¶¡£º

# patch -p1 < jfs-2.4.5-v1.0.4-patch

´ò²¹¶¡¹¤×÷Íê³É¡£

×îºóÔËÐÐ

££make menuconfig

½«ÐµÄÎļþϵͳ¼ÓÈëÁ˺ËÐıàÒëÅäÖÃÎļþÖУ¬Òª½øÐÐÒÔÏÂÄÚºËÅäÖãº

ʹÓÃmake menuconfig Ôڲ˵¥"Code maturity level options"ÖÐ,Ñ¡Ôñ"Prompt for development and/or incomplete code/drivers."Ñ¡ÏȻºó£¬½øÈëÎļþϵͳ²Ëµ¥"File systems"£¬Ñ¡Ôñ"JFS filesystem support."Ñ¡Ïî¡£ÅäÖúËÐÄ£¬Ê¹ºËÐÄÖ§³ÖJFSÎļþϵͳ¡£ÅäÖúËÐĵÄÆäËüÑ¡Ïî¡£

<*> JFS filesystem support



##½«JFSÎļþϵͳµÄÖ§³Ö±àÒëÈëÄںˣ¬Ò²¿ÉÒÔ½«Æä±àÒë³ÉÄ£¿é¼ÓÔØ·½Ê½£¬¼ûÒÔÏÂÑ¡Ôñ£º

JFS filesystem support

±ÊÕß½¨Ò齫JFSÎļþϵͳ֧³ÖÖ±½Ó±àÒë½øÄںˣ¬ÕâÓÐÀûÓÚÌá¸ßϵͳÐÔÄÜ¡£

È»ºó±àÒëºËÐÄ£º

#make dep

#make clean

#make bzImage

#make modules

#make modules_install

#cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.5-jfs

×îºó£¬±à¼­ /etc/lilo.conf Îļþ£¬¼ÓÈëÐÂÄÚºËÌõÄ¿£¬ÒÔ±ãʹÓÃеÄÄÚºËÒýµ¼ÏµÍ³¡£ÈçÏÂËùʾ£¬ÔÚ lilo.confÎļþÖмÓÈëÒÔϼ¸ÐÐÄÚÈÝ£º

image=/boot/vmlinuz-2.4.5-jfs

label=jfs

read-only

root=/dev/hda5

È»ºóÔËÐÐlilo£¬Ê¹¸ü¸ÄÉúЧ¡£

#lilo

Èý¡¢´´½¨JFSÎļþϵͳ

1£®²é¿´ÏµÍ³¶ÔJFSÎļþϵͳµÄÖ§³Ö

Èç¹ûеÄÄÚºËÕýÈ·Æô¶¯£¬Õâ˵Ã÷ºËÐÄÒÑÖ§³ÖJFSÎļþϵͳÁË¡£²é¿´ÏµÍ³½ø³Ì£¬¿ÉÒÔ¿´µ½ÒÔϽø³Ì£º

#lsmod

7 ? SW 0:00 [jfsIO]

8 ? SW 0:00 [jfsCommit]

9 ? SW 0:00 [jfsSync]

Èç¹ûÄã¿´µ½ÁËÒÔÉÏÕ⼸¸ö½ø³Ì£¬Õâ±íÃ÷ϵͳºËÐÄÒÑÖ§³ÖJFSÎļþϵͳ¡£

ÁíÍ⣬ÔÚ/proc/fs/jfs Ŀ¼ÏÂÓ¦¸Ã»¹ÓÐÈý¸öÎļþ£º

jfsFYI

logmgr

TxAnchor

2£®ÏÂÔرàÒëJFSÎļþϵͳ¹¤¾ß



ΪÁËʹÓÃJFSÎļþϵͳ£¬ÎÒÃÇ»¹ÐèÒª´´½¨ÎļþϵͳµÄ¹¤¾ß£¬µ½IBMµÄJFSÍøÕ¾ÏÂÔØÏàÓ¦¹¤¾ßjfsutils-1.0.7.tar.gzÈí¼þ°ü¡£

ÏÂÔصØÖ·£ºhttp://oss.software.ibm.com/developer/opensource/jfs/project/pub/jfsutils-1.0.7.tar.gz

±àÒë°²×°¹ý³ÌÈçÏ£º

#tar -zxvf jfsutils-1.0.7.tar.gz

#cd jfsutils-1.0.7

#./configure

#make

#make install

°²×°Íê³Éºó£¬ÔÚ/usr/sbinÖоͶà³öÒ»¸ö ¿ÉÖ´ÐÐÎļþmkfs.jfs£¬ÎÒÃǾÍÓÃËü½«·ÖÇø¸ñʽ»¯³ÉjfsÎļþϵͳ¡£

3£®´´½¨JFSÎļþϵͳ

ÒÔÏ¿ªÊ¼´´½¨Ò»¸öJFSÎļþϵͳ, ½«hda6·ÖÇø¸ñʽ»¯³ÉJFSÎļþϵͳ£¬ÒÔÏÂΪ¸ñʽ»¯Ê±ÏÔʾµÄÄÚÈÝ:

#mkfs -t jfs /dev/hda6

mkfs.jfs development version: $Name: v0_3_1 $

Warning! All data on device /dev/hda6 will be lost!

Continue? (Y/N) y

\

Format completed successfully.

5120608 kilobytes total disk space.

ÔËÐÐÍê³Éºó£¬JFSÎļþϵͳÒѾ­ÔÚhda6·ÖÇø´´½¨Íê³ÉÁË¡£

4£®¼ÓÔØJFSÎļþϵͳ

Ê×ÏÈ£¬´´½¨Ò»¸öĿ¼jfs£¬ÒԱ㽫JFSÎļþϵͳmountµ½ÆäÉÏ£º

#mkdir jfs

½«ÐµķÖÇømountµ½jfsĿ¼Ï£º

#mount -t jfs /dev/hda6 /jfs

ÕâÑù£¬ÐµÄÎļþϵͳ¾Í¼ÓÔص½/jfsĿ¼ÏÂÁË¡£ÏÖÔÚ¿ÉÒÔʹÓÃеÄÎļþϵͳÁË¡£

ËÄ¡¢Ê¹ÓÃJFSÎļþϵͳ

1£®ÆÕͨ·ÖÇøʹÓÃJFSÎļþϵͳ

LinuxÄÚºËÖ§³ÖÁËJFSÎļþϵͳºó£¬¿ÉÒÔ½«´ÅÅÌËùÓзÖÇø¾ù¸ñʽ»¯ÎªJFSÎļþϵͳ¡£Í¨³£Çé¿öÏ£¬½¨Òé/usr£¬/usr/sbinµÈ·ÖÇø²ÉÓ÷ÇÈÕÖ¾Îļþϵͳ£¬¶øÔÚÄÇЩ¶Ô¶ÁдҪÇóƵ·±µÄ·ÖÇøÉÏʹÓÃJFSÎļþϵͳ¡£ÕâÓÐÀûÓÚÌá¸ßϵͳÐÔÄÜ¡£

2£®Ö÷Òýµ¼ÇøʹÓÃJFSÎļþϵͳ

Ö÷·ÖÇøΪlinuxµÄÆô¶¯·ÖÇø£¬ÆäÖдæ·ÅÁËϵͳÆô¶¯ËùÐèµÄ»ù±¾Îļþ¡£ÒÔÏ¿ªÊ¼½«JFSÎļþϵͳÓÃÓÚÖ÷·ÖÇø£¬Ê×Ïȱ¸·ÝÖ÷·ÖÇøÉϵÄËùÓг£ÓÃÎļþĿ¼£º

#cd /

#cp -a bin etc lib boot dev home usr var [...] /jfs

#mkdir /jfs/proc

ÔÚʹÓÃJFSÎļþϵͳÆô¶¯Ö®Ç°£¬»¹Ó¦¸Ã¸ü¸Ä/etc/fstabÎļþ£¬½«ÏàÓ¦µÄ·ÖÇøÓÃ×÷¸ù·ÖÇø¡£ÈçÏÂËùʾ£ºÔ­À´µÄ¸ù·ÖÇøΪ£º

LABEL=/ / ext2 defaults 1 1

Ó¦¸Ã¸ü¸ÄΪ:

/dev/hda6 / jfs defaults 1 1

È»ºó£¬±àÒë/etc/lilo.confÎļþ£¬½«Ö÷Òýµ¼·ÖÇø¸ü¸ÄΪ/dev/hda6¡£ÖÃlabelΪjfs£¬½«È±Ê¡µÄÆô¶¯ÉèÖÃΪjfs¡£

ÈçÏÂËùʾ£º

default=jfs

...

image=/boot/vmlinuz-2.4.0-jfs

label=jfs

read-only

root=/dev/hda6

È»ºó£¬ÔËÐÐlilo£¬Íê³É¡£

×îºó£¬reboot ϵͳ£¬Æô¶¯Ö®ºó£¬Äã¾ÍµÃµ½Ò»¸ö´¿jfsÎļþϵͳµÄlinux»·¾³ÁË£¬Ê£ÏµÄÊÂÇé¾ÍÊǽ«Ô­À´µÄÖ÷·ÖÇøÖØиñʽ»¯³É jfs£¬È»ºóÔÙ½«Æämountµ½Ö÷·ÖÇøµÄij¸öĿ¼Ï¾ÍÐÐÁË¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. rosn ÓÚ 2005-12-15 09:28:47·¢±í:

    ºÃ¶«Î÷£¬ÑÏÖØÖ§³Ö£¬Ï£Íû¶à·¢µã