Ubuntu:Add New Harddisk

From Knowlege

Jump to: navigation, search

http://myerp-blog.blogspot.com/2008/11/ubuntu-add-new-harddisk.html

Contents

[edit] ตรวจดูเห็นฮาดดิสใหม่รึเปล่า

# 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


[edit] สร้างพาทิชั่นใหม่

#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.

[edit] ฟอแมตพาทิชั่น

#mkfs.ext3 /dev/sdb1

[edit] สร้าง mount

$mkdir /disk2
$mount /disk2 /dev/sdb1

[edit] สร้าง auto mount

vi /etc/fstab
เพิ่มที่ท้ายไฟล์ /dev/sdb1 /disk2 ext3 defaults,errors=remount-ro 0 1
Personal tools