How To Make A Partition
In this tutorial we will attach a new storage device and than will create a new partition.
after that will create a filesystem of respected partition and than will make a mount point with desired location.
after that will create a filesystem of respected partition and than will make a mount point with desired location.
Commands Overview
1) df -h (Show Mounted point with filesystem)
2) lsblk (Show Mounted point with filesystem in tree format)
3) sudo blkid (Show available partition with and without created filesystem)
4) fdisk (Show available storage devices)
Add/Attach new Hard-Disk.
# sudo fdisk -l
Partition number (3,4, default 3): 3
First sector (press enter for default value of sector)
Last Sector (select number and add G, M, K) Ex: +5G
Add/Attach new Hard-Disk.
- fdisk -l (use to view storage drive and also partition's)
# sudo fdisk -l
Create partition of new drive /dev/sdb
# sudo fdisk /dev/sdb
FDISK mange command
- m (for show command help)
- p (for view partition table)
- n (for create mew partion)
- d (for delete partition)
- w (for save all the activity)
Create New Partition
Command (m for help): n
Select (default p): p
First sector (press enter for default value of sector)
Last Sector (select number and add G, M, K) Ex: +5G
Command (m for help): p
- view your new partition, which you have created.
Command (m for help): w
- press w for save the partition.
- after creating partition use partprobe and kpartx and also you can do rebbot the machine.
After Rebooting The Machine
# sudo blkid
Now create File System of newer partition.
# sudo mkfs.ext4 /dev/sdb3
Now mount the partition in the particular directory.
# sudo mount /dev/sdb3 /tech2towards
Add Permanent mount point entry in /etc/fstab file.
# sudo blkid
# sudo mount /dev/sdb3 /tech2towards
- above command will temporary mount the directory on the partition.
- after reboot the server mounted directory will remove.
- add permanent mount point entry of directory in /etc/fstab file.
Add Permanent mount point entry in /etc/fstab file.
# sudo blkid
- copy below snap yellow marked line without comma(") from /dev/sdb3
- copy line will use in fstab entry.
# sudo nano /etc/fstab
- entry at the bottom of file, see below syntax.
- UUID=("paste uuid number without comma" ) /tech2towards ext4 defaults 0 0
- save the file Ctrl+x
- press y and enter
Now, Reboot the Machine, after reboot your mount point will added.
# df -h
No comments:
Post a Comment
testing