Home » Categories » Multiple Categories

Hướng dẫn thêm disk trên Linux

Để thêm disk và tạo partition trên Linux, ta có thể làm theo hướng dẫn bên dưới:

Bước 1: Dùng command fdisk -l để xác định disk vừa mới thêm vào.

Bước 2: Sau khi xác định được disk thêm vào, ta dùng command fdisk <new_disk> để tạo partition:

Vd:

[root]# fdisk /dev/sdb
Command (m for help): m     (Enter the letter "m" to get list of commands)
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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-9729, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-9729, default 9729):
Using default value 9729

Command (m for help): w    (Write and save partition table)


Bước 3: Sau khi tạo partition hoàn tất, ta sẽ tiến hành định dạng cho partition bằng command: mkfs.ext4 <new_partition>

Vd: mkfs.ext4 /dev/sdb1

Bước 4: Sau khi định dạng cho partition thành công, ta sẽ mount partition vào mount point bằng command: mount -t ext4 <new_partition> <mount_point>

Vd: mount -t ext4 /dev/sdb1 /home2

Bước 5: Để cho việc mount tự động, ta tiến hành cấu hình trong file /etc/fstab

Vd: /dev/sdb1 /home2 ext4 defaults 1 1

       
      Attachments Attachments
      There are no attachments for this article.
      Comments Comments
      There are no comments for this article. Be the first to post a comment.
      Related Articles RSS Feed
      Hướng dẫn đổi mật khẩu của bất kì User nào trên Directadmin với quyền Admin.
      Viewed 5363 times since Sun, Aug 16, 2015
      Làm gì khi IP bị blacklist
      Viewed 51857 times since Wed, Apr 15, 2015
      Hướng dẫn cài đặt Zend optimizer on centos 6.x
      Viewed 5453 times since Sun, Jan 25, 2015
      Hướng dẫn tạo SOCKS 5 proxy via SSH bằng phần mềm Putty
      Viewed 57296 times since Wed, Jan 21, 2015
      Hướng dẫn connect VPS Linux
      Viewed 21834 times since Sat, Dec 27, 2014
      Hướng dẫn đổi port mặc định của DirectAdmin và SSH
      Viewed 9483 times since Fri, Apr 24, 2015
      Hướng dẫn cài đặt PPTP VPN linux-Centos
      Viewed 4371 times since Thu, Jan 22, 2015
      Hướng dẫn Addon một domain cho User trên DirectAdmin
      Viewed 1775 times since Sun, Aug 16, 2015
      Hướng dẫn kiểm tra tốc độc mạng với Iperf
      Viewed 42667 times since Wed, Aug 24, 2016
      Sự khác nhau giữa VPS SSD Caching và VPS SSD
      Viewed 2887 times since Sat, Apr 4, 2015