Linux ไม่ยากกว่าที่คิด
ภก.การุณ
จันทรัตน์
บทที่ 1 แนะนำ Linux
เมื่อ คศ. 1991 Linus
Tolvalds นักศึกษาชาวฟินแลนด์
ได้วางเสาเอกของ Linux โดยอาศัยแนวคิดของระบบปฏิบัติการ Minix
และได้แจกจ่ายให้โปรแกรมเมอร์ทั่วโลกได้นำไปพัฒนาต่อ
และอยู่ภายใต้ลิขสิทธิ์ ของ GPL. ที่สามารถนำไปใช้งานได้โดยไม่ต้องเสียค่าใช้จ่ายใดๆ
Linux กับระบบปฏิบัติการอื่นๆ
เราสามารถติดตั้ง Linux ร่วมกับระบบปฏิบัติการตัวอื่นๆได้ ไม่ว่าจะเป็น Windows 95/98 , NT ฯลฯ และยังสามารถทำระบบการบูตคู่ (Dual Boot) ที่สามารถเลือกได้ว่า เราจะบูตสู่ Linux หรือ Windows และ สามารถทำงานร่วมกันได้อย่างดี
บทที่ 2 การติดตั้ง Linux
ความต้องการเบื้องต้น
1. CPU. 386/486 ขึ้นไป
2. REM 8 MB. Up ถ้าใช้งาน X Windows
จะต้องมีอย่างน้อย 16 MB.
3. BUS แบบ ISA,EISA, VESA
4. Hard Disk จะเป็นแบบ IDE หรือ SCSI ก็ได้
5. จอภาพ
6. คีย์บอร์ด& เมาส์
7. CD ROM
8. Lan Card ถ้าต้องการเชื่อมต่อกับ Network
สร้างแผ่นบูต
FORMAT.COM
FDISK.EXE
SYS.COM
EDIT.COM
VIDE-CDD.SYS
การลง Linux ในแบบต่างๆ
แบบที่1 ลง Linux เพียงระบบเดียว
แบบที่2 ลง Linux ร่วมกับระบบปฏิบัติการอื่น และ Linux เป็นระบบหลัก
แบบที่3 ลง Linux ร่วมกับระบบปฏิบัติการอื่น และ Linux เป็นระบบรอง
การลง Linux เพียงระบบเดียว
1. สร้างแผ่นบูตของ Linux
2.
เริ่มต้นเข้าสู่ระบบติดตั้ง
3. การปรับแต่ง Hard Disk
4. เลือก Component ที่ต้องการ
5.
การกำหนดค่าตัวเลือกต่างๆ
6. การติดตั้ง LILO
1.การสร้างแผ่นบูต
ของ Linux
1. ใส่แผ่น CD Linux และ แผ่นเปล่า 1.44 MB
2. D:\> cd dosutils
D:\
DOSUTILS >
3. D:\DOSUTILS > rawrite -f \images\Boot.img
Enter target diskette drive: a:
Please insert a
formatted diskette into drive A:
2.
เริ่มต้นเข้าสู่ระบบติดตั้ง
บูตจากแผ่นบูต
1. General
2. Expert
3. Rescue
บูตจากแผ่น CDROM
ถ้า Mainboard ของเราเป็นรุ่นใหม่ ที่รองรับการบูตระบบจาก CDROM ระบบติดตั้งจากแผ่นก็จะโหลดและเข้าสู่การติดตั้งโดยอัตโนมัติ
บูตจาก DOS โดยใช้ Autoboot.bat จากไดเร็กทอรี่ DOSUTILS
การเลือกชนิดของจอภาพ
เลือกสื่อที่เราจะติดตั้ง
เลือกรูปแบบการติดตั้ง
เลือกชนิดของ SCSI Adapter
3. การปรับแต่ง Hard Disk
เครื่องมือที่ใช้แบ่ง
Partition มีอยู่ 2 ตัว คือ
Disk Druid
มี Interface ใช้ง่ายๆ
FDISK จะเป็นโปรแกรมแบบ Command Line
การจัดลำดับของ Hard Disk ใน Linux
**Linux จะมองเห็น HDD. เป็นอุปกรณ์ตัวหนึ่ง**
Primary Master C:
Slave D:
Secondary Master E:
Slave F:
เปรียบเทียบการตั้งชื่อ
Hard Disk ของ DOS และ Linux
Primary Master C: = /dev/hda
Slave D: = /dev/hdb
Secondary Master E: = /dev/hdc
Slave F: = /dev/hdd
ถ้าเราตัดแบ่ง Partition ให้กับ Hard Disk
Primary Master = /dev/hda
Partition
1 = /dev/hda1
Partition
2 = /dev/hda2
Slave = /dev/hdb
Partition
1 = /dev/hdb1
Partition
2 = /dev/hdb2
การตัดแบ่ง Partition สำหรับ Linux
1. Linux native Root
Partition
2. Linux Swap Virtual
Partition
การกำหนดขนาดของ Partition
Swap Partition อย่างน้อยเท่ากับ RAM
เลือก Root Partition
ในกรณีที่เรามีหลาย Partition ต้องมีการกำหนดให้ Partition
หนึ่งในนั้น เป็น Root
เลือก Swap Partition
ฟอร์แมต Partition เลือก Partition Linux native ที่ต้องการจะฟอร์แมต ให้เครื่องหมายที่ /dec/hda1
4. เลือก Component ที่ต้องการจะติดตั้ง
ตัวอย่างตัวเลือกของ Package ต่างๆ
Printer Support
X Windows System
Mail/WWW/News
Tools
File Managers
Graphics
Manipulation
X Games
Console Games
X Multimedia support
SMB Connective
NFS Server
5. การกำหนดค่าตัวเลือกต่างๆ
เลือกชนิดของเมาส์
เลือกชนิดของการ์ดจอ
เลือกชนิดของจอภาพ
การปรับแต่งระบบ Network
Default
Gateway Primary
nameserver
ปรับแต่งเวลาระบบ
กำหนดการเริ่มทำงานของ Service
การติดตั้งเครื่องพิมพ์
1. Local
2. Remote
lpd
3. LAN
Manager
กำหนด Password ของ Root
6. การกำหนด LILO
1. ติดตั้งลงใน MBR (/dev/hda)
2. ติดตั้งลงใน Sector แรกของ Boot Partition (/dev/hda1)
การลง Linux ร่วมกับระบบปฏิบัติการอื่นและ Linux เป็นระบบหลัก
1. สร้าง Partition ใหม่ โดยใช้ Fdisk สร้าง 1 Partition
ที่มีขนาด 1 GB เพื่อลง Windows95
2. ติดตั้ง Windows95
3. สร้าง Partition สำหรับ Linux โดยใช้ Fdisk สร้าง
อีก 2 Partition จะได้ Linux native และ Linux
Swap
4. ติดตั้ง Linux ตามขั้นตอน
5. ติดตั้ง LILO
** เพราะเครื่องจะบูต Linux ได้แล้วยังสามารถบูต
เข้าสู่ Windows95 ที่อยู่ใน Partition
แรกได้ด้วย**
การลง Linux ร่วมกับระบบปฏิบัติการอื่นและ Linux เป็นระบบรอง
1. สร้าง Directory ชื่อ LOADLIN
2. Unzip ไฟล์ Loadlin
3. Copy ไฟล์ Kernel และ image
4. เขียนแบตช์ไฟล์ Linux.bat
บทที่ 3 การใช้งาน Linux เบื้องต้น
Login เข้าสู่ระบบ
Red Hat Linux
release 5.2 (Apollo)
Kernel 2.0.36 On an i586
w3 login :
w3 login : root
Password :
[root@w3 /root]#
![]() |
ls = dir ใน DOS นั่นเอง
[root@w3 /root]# ls -l
total 0
[root@w3 /root]#
hardware
การเปลี่ยน Password ของ rootใช้คำสั่ง passwd เพื่อเปลี่ยนรหัสผ่าน ดังนี้
[root@w3 /root]# passwd
New UNIX password: ******
Retype new UNIX
password: ******
Password: all
authentication tokens updated successfully
|
|
![]() |
คำสั่งต่างๆที่ควรทราบ (Common Command)
การสร้างเท็กซ์ไฟล์ ใช้คำสั่ง cat ตามด้วย > และ ชื่อไฟล์
[root@w3 /root]# cat
>test.txt
Hello Linux, it is
easy for me
[root@w3 /root]#
การเรียกดูข้อมูล ใช้คำสั่ง cat ตามด้วย ชื่อไฟล์
[root@w3 /root]# cat
test.txt
Hello Linux, it is
easy for me
[root@w3 /root]#
การcopyไฟล์
ใช้คำสั่ง cp ตามด้วยชื่อไฟล์
[root@w3 /root]# cp test..txt hello.txt
[root@w3 /root]# ls -l
total 2
-rw-rw-r1 root root 32 Mar 21 22.18 hello.txt
-rw-rw-r1 root root 32 Mar 21 22.04 test.txt
[root@w3 /root]#
การย้ายไฟล์ และเปลี่ยนชื่อไฟล์ ใช้คำสั่ง mv ตามด้วย ชื่อไฟล์
[root@w3 /root]# mv
hello.txt /bin
การสร้างไดเร็กทอรี่ ใช้คำสั่ง mkdir ตามด้วยชื่อ
[root@w3 /root]# mkdir
data
[root@w3 /root]# ls -l
total 3
drwxrwxr-x 2 root root 1024 Mar 21 22.26 data
-rw-rw-r--
1 root root 32 Mar 21 22.18 hello.txt
-rw-rw-r--
1 root root 32 Mar 21 22.04 test.txt
[root@w3 /root]#
การเข้าไปในไดเร็กทอรี่ ใช้คำสั่ง cd ตามด้วยชื่อ
[root@w3 /root]# cd data
[root@w3 data]#
การออกจากไดเร็กทอรี่ ใช้คำสั่ง cd ..
[ root@w3 data ]# cd ..
[ root@w3 /root ]#
[ root@w3 bin ]# cd
[ root@w3 /root ]#
การแสดงไดเร็กทอรี่ปัจจุบัน ใช้คำสั่ง pwd
การลบไดเร็กทอรี่
ใช้คำสั่ง rmdir
[ root@w3 /root ]# rmdir
data
การ Logout ใช้คำสั่ง logout หรือ exit
[ root@w3 data ]# exit
การ Shutdown ใช้คำสั่ง shutdown ตามด้วย option
[ root@w3 data ]#
shutdown -r now
[ root@w3 data ]#
shutdown -h now
การใช้งาน vi ,pico
vi ได้ชื่อว่าเป็น Text Editor ตัวหนึ่งในระบบ
UNIX ถ้า Windows มี Notepad เป็น Editor UNIX ก็มี vi เป็น Editor ตัวเก่งเช่นกัน
จะมี 2 โหมดการทำงานคือ
1. โหมดคำสั่ง (Command Mode )
2. โหมดแก้ไขข้อมูล ( Edit Mode )
[root@w3 /root]# vi
[root@w3 /root]# vi
hello.txt
รู้จักกับไดเร็กทอรี่ต่างๆ
bin เก็บคำสั่งต่างๆของระบบ เช่น ls,cp,mv,rmdir,pwd,mail,cat
boot เก็บไฟล์ต่างๆที่ใช้ในการ boot เช่น boot , map , vmlinuz
dev เก็บไฟล์ดีไวซ์ของอุปกรณ์ต่าง เช่น Hard Disk , CDROM , Modem
etc เก็บไฟล์ Configuration,ค่าต่างๆของ
LILO, Password
home เมื่อมี User ใหม่ Account จะถูกสร้างในไดเร็กทอรี่ Home นี้
lib เก็บไลบราลี่ต่างๆ เช่น ภาษา C เพราะ Linux พัฒนามาจากภาษา C
mnt เป็นไดเร็กทอรี่ปลายทางในการ Mount อุปกรณ์คือ floppy,CDROM
root เป็นไดเร็กทอรี่ของผู้ดูแลระบบ
sbin คล้ายๆกับ bin แต่สำคัญรองลงมา
tmp ไม่ต้องบอกก็รู้ว่าเก็บอะไร
usr เป็นไดเร็กทอรี่ที่เก็บโปรแกรมต่างๆ ซี่ง X Windows ก็ถูกเก็บไว้ที่นี่
var เป็นไดเร็กทอรี่ที่เก็บโปรแกรมต่างๆ,ข้อมูลที่ถูกเรียกใช้โดยระบบ เช่น Cache ของ Web
Server หรือ Spool ของเครื่องพิมพ์
โหมดของไฟล์ในระบบUNIX
ถ้าหากเราใช้คำสั่ง ls -l เรียกดูรายชื่อไฟล์ต่างๆ ใน Accout ของเราดังนี้
[root@w3 kwangd]# ls
-l
total 4
drwxrwxr-x 2 kwangd
kwangd 1024 Mar 21 1999 data
-rw-rw-r- 1 kwangd kwangd 32 Mar 21 1999 hello.txt
drwxrwxr-x 2 root
root 1024 Mar 23 00.54
mail
-rw-rw-r- 1 kwangd kwangd 32 Mar 21 1999 test.txt
[root@w3 kwangd]#
d r w x r w x r - x
ตัวที่ 1
บอกถึงความเป็นไดเร็กทอรี่
ตัวที่ 2,3,4 บอกถึงPermission ในการ read,write,execute โดยตัวเจ้าของ
ตัวที่ 5,6,7 บอกถึงPermission ในการ read,write,execute ในระดับกลุ่ม
ตัวที่ 8,9,10 บอกถึงPermission ในการ read,write,execute ในระดับบุคคลภายนอก หรือผู้ใช้อื่นๆ
Floppy disk
|
|
TERMINAL USER
ถ้าไม่มีการ Mount เราก็จะไม่สามารถเข้าถึงข้อมูลในสื่อนั้นๆ ได้
# mount [ตัวเลือกต่างๆ] [ชื่อดีไวซ์] [ไดเร็กทอรี่ปลายทาง]
การ Mount แผ่นดิสก์
[ root@w3 /root ]# mount /dev/fd0 /mnt/floppy
ถ้าการ Mount สำเร็จ จะแสดงข้อความว่า
[ root@w3 /root ]# mount /dev/fd0 /mnt/floppy
mount:block
device /dev/fd0 is write-protected,mounting
read-only
[ root@w3 /root ]#
การยกเลิก Mount
[ root@w3 /root ]# unmount
/dev/fd0
[ root@w3 /root ]#
การ Mount
Hard disk
[ root@w3 /root ]# mount /dev/hda1 /mnt/c
[ root@w3 /root ]# cd /mnt/c
[ root@w3 /root ]# ls
การ Mount
CDROM
[ root@w3 /root ]# mount -t iso9660 /dev/hdc /mnt/cdrom
การ เตรียม Work Station
1. ติดตั้ง Windows 95 , 98 , 2000
2. ติดตั้งระบบ Client for Microsoft network
3. ติดตั้ง TCP/IP และกำหนด IP Address ,Network Mask
4. Enable Plain Text Password โดย RUN
regedit
5. สร้าง File Timesync.bat
Net
use F:\\maelao\mrecord /yes
Net
time \\maelao /set /yes
การติดตั้ง
และใช้งาน SAMBA
hostname = maelao
netbios name = maelao
TCP/IP address = 192.168.1.1
subnet mask = 255.255.255.0
broadcast address = 192.168.1.0
workgroup name and
domain name = mrecord
Computer name = pharmacy
TCP/IP address = 192.168.1.10
subnet mask = 255.255.255.0
broadcast address = 192.168.1.0
workgroup name and
domain name = mrecord
access control of network = share
level access control
Creat file smb.conf (etc/smb.conf)
[global]
workgroup = mrecord
comment = Redhat
Samba Server
volume = Redhat6.2
printing = bsd
printcap name = /etc/printcap
load printers = yes
map to guest = bad user
guest account = nobody
log file = /var/log/samba-log.%m
max log size = 50
short preserve case = yes
preserve case = yes
log directory = /var/log/samba
locking = no
strict locking = no
share modes = yes
security = user
encrypt password = no
socket options = TCP_NODELAY
os level = 17
preferred master = yes
dns proxy = no
smb passwd file = /etc/smbpasswd
[homes]
comment
= Home Directories
browseable
= no
read
only = no
preserve
case = yes
short
preserv case = yes
create
mode = 0750
[printers]
comment
= All Printers
path
= /var/spool/samba
browseable
= no
printable
= yes
public
= yes
writable
= no
create
mode = 0700
[public1]
comment
= Public1 Read Only
path
= /home/samba/public1
public
= yes
writable
= no
[public2]
comment
= Public2 Read-Write
path
= /home/samba/public2
public
= yes
writable
= yes
force
directory mode = 0777
force
create mode = 0777
Creat file /etc/lmhosts และ /etc/hosts)
# cat /etc/lmhosts
127.0.0.1 local
host
192.168.1.1 maelao
192.168.1.10 pharmacy
# cat /etc/hosts
127.0.0.1 local
host
192.168.1.1 maelao
192.168.1.10 pharmacy
โปรแกรม nmbd จะใช้ไฟล์ /etc/lmhosts นี้เพื่อกำหนด NETBIOS name กับ TPC/IP address เมื่อเครื่อง client ติดต่อกับเครื่อง maelao เพื่อขอใช้แชร์ต่างๆ
แต่ถ้าในระบบมีเครื่องที่ทำหน้าที่เป็น WINS server หรือ DNS อยู่แล้ว ก็สามารถข้ามขั้นตอนนี้ได้
1. ติดตั้ง Windows 95 , 98 , 2000
2. ติดตั้งระบบ Client for Microsoft network โดย คลิก Start
>Setting>Control Panel >>Network > Add >
client > Client For
microsoft Network
3. ติดตั้ง TCP/IP โดย คลิก Start
>Setting>Control Panel >>Network > Add > Protocol > TCP/IP และ
กำหนด IP Address ,Network Mask
4. Enable Plain Text Password โดย RUN > regedit >+HKEY_Local
Machine > + System > + Current
Control Set > + Service
> +Vxd > VNETSUP >> Enable Plain Text
Password = 1
5. สร้าง File Timesync.bat
Net
use F:\\maelao\mrecord /yes
Net
time \\maelao /set /yes
ทดสอบการติดตั้ง
1. Testparm
รูปแบบคำสั่ง
# cd /etc
# testparm smb.conf
|more
2. Ping
-IP
Address
# ping 192.168.1.1
- Host Name
# ping maelao
3. Smbstatus
# smbstatus
โปรแกรมคำสั่งและไฟล์ต่างๆของ
Samba Server
ส่วนที่ 1 :
ไฟล์กำหนดพารามิเตอร์ต่างๆ ( smb.conf
)
เป็นการกำหนดลักษณะการทำงานทั้งหมดของ
Samba Server ได้แก่
กำหนดชื่อ NetBIOS name,ชื่อ workgroup
หรือชื่อ NT domain name
กำหนดรูปแบบการแชร์ว่า จะให้ Samba
Server นี้เป็นแบบ share level หรือ user level
กำหนดให้ Samba Server นี้
ทำหน้าที่เป็น mater browser หรือ domain master
browser
หรือ WIN server หรือไม่
กำหนดให้ Samba Server นี้
ควบคุม network logon ของเครื่อง client ที่ใช้
Windows
95/98หรือไม่
กำหนดว่าจะเปิดแชร์ดิสก์หรือ path ใดบ้าง และจะให้ user ใดเข้ามาใช้ได้บ้างและมีสิทธิ
การใช้งานแค่ไหน
กำหนดว่าจะเปิดแชร์พรินเตอร์ของSamba server เครื่องใดบ้าง ให้กับ user ใดบ้าง
และให้ทำงานอย่างไร
กำหนดว่าจะเก็บไฟล์ log ของ samba ไว้ที่ไหนและเก็บข้อมูลระดับไหน
ส่วนที่ 2 : ไฟล์โปรแกรมหลัก smbd และ nmbd
smbd
ทำหน้าที่เป็น SMB
Server
nmbd ทำหน้าที่เป็น NetBIOS
Name Server ให้กับเครื่อง client
ส่วนที่ 3 : ไฟล์โปรแกรม utilities เพื่อรันงานต่างๆ
บน Samba Server
nmblookup client
ใช้ค้นหา NetBIOs Name ที่เปิดแชร์ดิสก์หรือ
printer
smbcliet client
ใช้ติดต่อกับ SMB Server อื่นๆ
smbstatus ตรวจสอบสภาวการณ์แชร์ดิสก์,ไฟล์และprinter ของ Samba
Server
mksmbpasswd.sh convertไฟล์ passwordแบบ Unixให้เป็นไฟล์ smbpassword แบบมี encryption
addtosmbpass เพิ่ม user ใหม่ให้กับไฟล์ smbpasswd
smbpasswd เมื่อ login ด้วย root จะเป็นโปรแกรมสำหรับจัดการ SMB username และ smb password
ทั้งหมด แต่เมื่อ login ด้วย user account อื่นๆ จะใช้ สำหรับเปลียน
password ของ SMB user ของ user นั้นๆ
Smbrun เป็นโปรแกรมทำหน้าที่อินเตอร์เฟสระหว่างโปรแกรม smbd กับโปรแกรมภาย
นอกอื่นๆ
testparm เป็นโปรแกรมที่ใช้ตรวจสอบความถูกต้องของไฟล์ smb.conf
testprns เป็นโปรแกรมที่ใช้ตรวจสอบความถูกต้องของ printer name ว่ามีในไฟล์ /etc/printcap หรือไม่
SWAT เป็นโปรแกรมใช้จัดการและควบคุมระบบ Samba แบบ GUI โดยผ่าน Web Browser
การกำหนด crontab
เพื่อตั้งเวลา รัน Script
1. สร้างไฟล์คำสั่ง
ชื่อ mrecbak ที่ /sbin/mrecbak
#! /bin/sh
set @date
echo $1
newdir = $1
rsync -avc /home/mrecord/mis/DATA/* /home/$newdir
2. สร้างไฟล์ ชื่อ mycrontab
ที่ /root
0 0 * * 1,3,5 /sbin/mrecbak
3. chmod 777 /usr/bin/mrecbak
4. crontab mycrontab
ในกรณีที่ต้องการให้ทำงานทุกครั้งที่เปิดใช้งานในนำข้อ
4 ไปเขียนใน ไฟล์ /etc/inettab
นาที ชั่วโมง วันที่ เดือน วัน script
0 */2 * * * /sbin/mrecbak
ให้ทำตามคำสั่ง mrecbak ทุก 2 ชม.
0 23-7/2,8 * * * /sbin/mrecbak
ให้ทำตามคำสั่ง mrecbak ทุก 2 ชม. ในช่วงเวลา 5 ทุ่มถึง 7โมง และ 8โมงเช้า
0 11 4 * mon-wed /sbin/mrecbak
ให้ทำตามคำสั่ง mrecbak 11 โมงเช้า วันที่ 4
วันจันทร์ ถึง วันพุธ
0 4 1 jan * /sbin/mrecbak
ให้ทำตามคำสั่ง mrecbak ตี4 วันที่ 1 เดือน มกราคม
GateWay & IP Sharing
1. แก้ไขไฟล์ /proc/sys/net/ipv4/ip_forward
โดยเปลี่ยน ip_forward=1
2. แก้ไขไฟล์ /etc/sysconfig/network โดยเปลี่ยน ipv4_forward=true หรือ yes
3.เติมคำสั่งเหล่านี้ในไฟล์
/etc/rc.d/rc.local
/sbin/ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up
/sbin/route add -net 192.168.1.0 netmask 255.255.255.0 eth0
/sbin/route add default gw
192.168.1.1 eth0
ipchains -P forward
DENY
ipchains -A forward
-j MASQ -s 192.168.0.0/24 -d 0/0
start > settings
> Control Panel > network เปิดแล้วเลือกที่เป็น TCP/IP >Card Lan
>>Properties จากนั้นให้กำหนดค่าต่างๆ
ดังนี้ :-
- GateWay กำหนดค่าเป็น
192.168.1.1 (ตรงช่อง new
gateway แล้ว add เข้าไป)
- IP Address
ตรง Specify an IP Address กำหนดค่าเป็น
192.168.1.2
- Subnet Mask กำหนดค่าเป็น 255.255.255.0
วิธีการเพิ่ม Disk
1. ทำการแบ่ง Partition และ เปลี่ยน ID เป็น Linux(83) โดยใช้คำสั่ง fsdisk
2. Format Partition ที่แบ่งใหม่ โดยใช้คำสั่ง mkfs
/sbin/mkfs -t ext2 /dev/hdb2 [Partitions
Size]
3. สร้าง directory เตรียมไว้สำหรับการ mount
disk เข้ามาไช้ เช่น mkdir /home/usr2
4. Mount disk เข้ามาไว้ใน Directory
ที่ได้สร้างไว้ คือ /sbin/mount -t ext2 /dev/hdb2
/home/usr2
5.หลังจากทำการ mount เสร็จแล้ว ก็จะสามารถใช้พื้นที่ของ Partition /dev/hdb2 ได้ภายใต้ directory ของ
/home/usr2
6. หากต้องการจะให้ทำการ
mount partition โดยอัตโนมัติตั้งแต่ตอนเริ่มบูตระบบ
ให้เข้าไปแก้ไขในไฟล์
/etc/fstab ตามรูปแบบดังนี้
/dev/hdb2 /home/usr2 ext2 defaults 1 1
1. init 1
2. /sbin/e2fsck /dev/(ชื่อ
device เช่น hda)
3.ถ้ามี
error ระบบ จะถามว่าจะจัดการกับ fault หรือ chain ดังกล่าวหรือไม่
ให้ตอบ y
4.shutdown -r now