📖
Isu's Wiki
  • Welcome to Isu's Wiki
  • Linux
    • SSH Automatic Login
    • Nginx HTTPS
    • Nginx Login Page
    • OpenVPN Server
    • PPTP Client Settings
    • LVM Allocation
    • Partition and Mount
    • Vagrant and VirtualBox
    • Bind9 SRV Record
    • Git Two Remote
    • ESXi Nvidia - 525.89.02
    • Install Qemu
    • Recover network (no netplan, iproute2)
  • Kubernetes
    • Kubernetes Reset
    • x509 Certificate Renewal
  • LaTeX
    • Code Snippet with Box in LaTeX
  • Go
    • [gRPC] Generate .pb.go from .proto
  • eBPF
    • [Kprobe] Get Argument Values
    • [Cilium] TroubleShooting
    • [Python] Install BCC
  • MicroStack
    • [Microstack] Add Image
    • [Microstack] Quota Manage
    • [Microstack] Security Group
    • [Microstack] Overcommit Resources
  • CentOS
    • Change Interface Name
    • Install Vagrant with vagrant-libvirt
  • OpenStack
    • [Nova] noVNC not working
    • [Basic] OpenStack Installation
    • [Magnum] TroubleShooting
Powered by GitBook
On this page
  • Generate Partition
  • Format Partition
  • Mount Partition
  1. Linux

Partition and Mount

Make a partition and mount it to directory

Generate Partition

Let's assume that we have a disk named /dev/sdb, then make partition with the disk.

sudo fdisk /dev/sdb

This will bring up the fdisk utility. Then we are going to generate partition: Just press n and press enter (if you do not want any options and are willing to use the whole disk)

Command (m for help): n
Partition number (1-128, default 1):
First sector (34-1953525134, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-1953525134, default 1953525134):

Created a new partition 1 of type 'Linux filesystem' and of size 931.5 GiB.

Then use w to write information to disk

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Format Partition

Format partition using mkfs:

sudo mkfs -t ext4 /dev/sdb1

This will generate file system of /dev/sdb1 as ext4. If you would like other file systems, use this accordingly.

Mount Partition

Once generating partition and formatting a partition was done, it is time for mounting. Let's assume that we would like to mount partition/dev/sdb1 to /home2 directory.

mkdir /home2
sudo mount -t auto /dev/sdb1 /home2

This will mount /dev/sdb1 to /home2 directory.

PreviousLVM AllocationNextVagrant and VirtualBox

Last updated 2 years ago