การติดตั้งฮาร์ดดิสก์ตัวใหม่ใหักับ Ubuntu |
จัดทำเมื่อ 26-09-2009
โดย อดิศร ขาวสังข์
อ้างอิง http://wiki.zyntag.com/Ubuntu:Add_New_Harddisk
ตรวจดูเห็นฮาร์ดดิสก์ใหม่หรือไม่
# fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdbe8dbe8
Device Boot Start End Blocks Id System
/dev/sda1 * 1 29650 238163593+ 83 Linux
/dev/sda2 29651 30401 6032407+ 5 Extended
/dev/sda5 29651 30401 6032376 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xec5563c4
Device Boot Start End Blocks Id System
/dev/sdb1 1 60801 488384001 83 Linux |
หมายเหตุ ในกรณีที่ท่านใช้ HDD ตัวใหม่ที่เคยลง Linux แล้ว อาจจะมี device ตัวใหม่ที่ต่างออกไปดังต่อไปนี้
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e0f47
Device Boot Start End Blocks Id System
/dev/sdb1 1 3 24097 83 Linux
/dev/sdb2 4 391 3116610 82 Linux swap / Solaris
/dev/sdb3 392 20529 161758485 83 Linux
/dev/sdb4 * 20530 60801 323484840 83 Linux
|
ซึ่งถ้าเป็น case แบบนี้ ค่าของ sdb ก็จะต่างออกไป ให้เืลือกจัดการกับ device ให้ถูกต้องด้วย
สร้างพาร์ติชันใหม่
#fdisk /dev/sdb1
# n
# p
# 1
# enter
# enter
# w |
=>Fdisk will display the following menu
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help):
=> We want to add a new partition. Type "n" and press enter.
Command action
e extended
p primary partition (1-4)
=>We want a primary partition. Enter "p" and enter.
Partition number (1-4):
=>Since this will be the only partition on the drive, number 1. Enter "1" and enter.
Command (m for help):
=> Now that the partition is entered, choose option "w" to write the partition table to the disk. Type "w" and enter.
The partition table has been altered!
=>If all went well, you now have a properly partitioned hard drive that's ready to be formatted. |
ฟอร์แมตพาร์ติชัน
สร้าง mount
$mkdir /disk2
$mount /disk2 /dev/sdb1
|
สร้าง auto mount
vi /etc/fstab
เพิ่มที่ท้ายไฟล์ /dev/sdb1 /disk2 ext3 defaults,errors=remount-ro 0 1
|
จบครับ
|
|