• Thông Tin Cần Biết
  • Hướng Dẫn
  • Câu Hỏi Thường Gặp
  • Thông Tin Cần Biết
  • Hướng Dẫn
  • Câu Hỏi Thường Gặp
Home/Hướng Dẫn/Linux/Ubuntu – Hướng dẫn mở rộng (Resize) dung lượng disk default

Ubuntu – Hướng dẫn mở rộng (Resize) dung lượng disk default

3 lượt xem 0

Làm thế nào để mở rộng dung lượng lưu trữ gốc của máy chủ Ubuntu?

  1. Resize the Partition:  Khi đĩa ảo lớn hơn, bạn cần thay đổi kích thước phân vùng (sda3) để chiếm thêm không gian. Bạn có thể sử dụng tiện ích fdisk hoặc parted để thực hiện việc này:
    • If you’re using fdisk, run:
      sudo fdisk /dev/sda
      

      Then, delete and recreate partition 3 (sda3) with the new size, making sure it covers the entire available space. After making the changes, save and exit.

    • If you’re using parted, run:
      sudo parted /dev/sda
      (parted) resizepart 3
      

      Follow the prompts to resize the partition to occupy the entire available space.

  2. Resize the LVM Physical Volume: Now that the partition is resized, you need to resize the LVM Physical Volume (PV) to recognize the increased space. Run the following command:
    sudo pvresize /dev/sda3
    
  3. Extend the Logical Volume (LV): After resizing the PV, you can extend the LV (/dev/ubuntu-vg/ubuntu-lv) to use the newly available space. Use the lvextend command:
    sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
    

    This command extends the LV to use 100% of the available free space in the VG.

  4. Resize the Filesystem: Finally, you should resize the filesystem to utilize the newly allocated space:
    sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
    

    This command resizes the filesystem to match the size of the LV.

After completing these steps, your Ubuntu partition should have been successfully resized to utilize the additional space.

Bài viết này hữu ích không?

Yes  No
Bài viết liên quan
  • Ubuntu 22.04 – Add User
  • Ubuntu 22.04 – Enable root user
  • CentOS 8 – Fix lỗi Failed to download metadata for repo ‘AppStream’
  • CentOS 7 – Fix lỗi Not found trying other mirror
  • Tổng hợp lệnh RPM trên Linux
  • Xử lý lỗi full Inode trên server DirectAdmin

Không tìm thấy câu trả lời của bạn? Liên hệ

Linux
  • Ubuntu – Hướng dẫn mở rộng (Resize) dung lượng disk default
  • Reset password root trên CentOS 7
  • How to Install Debian 11
  • Tìm và xóa file Zero-Byte trong Linux
  • Cài đặt ConfigServer Security & Firewall (CSF) trên CentOS
  • Ubuntu 20.04 – Thiết lập địa chỉ IP tĩnh (Static IP Address)
  • Xử lý lỗi full Inode trên server DirectAdmin
  • Tổng hợp lệnh RPM trên Linux
  • CentOS 7 – Fix lỗi Not found trying other mirror
  • CentOS 8 – Fix lỗi Failed to download metadata for repo ‘AppStream’
  • Ubuntu 22.04 – Enable root user
  • Ubuntu 22.04 – Add User
All Categories
  • WordPress Website
  • Quản trị Website
  • Quản lý tài khoản
  • Tên miền
  • Chứng chỉ số SSL
  • Email Hosting Server
  • Web Hosting
  • VPS / Server
  • Plesk
  • DirectAdmin
  • Networking
  • Linux
  • Windows
© BizMaC | Rainbow E-Commerce