WhileNetworking

  • Home
  • CCNA
  • Cisco Packet Tracer Download
    • Cisco packet tracer 6.3
    • cisco packet tracer 6.2
    • Cisco Packet Tracer 7
  • Linux Server Management
  • About Us
  • Privacy Policy
  • Contact Us

Partition management in Linux (CentOS/Red Hat)

You are most welcome to this post.
network connection show in Linux
Really thanks to you for your interest in this topics. :)

Hope that your are enjoying Linux. Now in this post we’ll learn, partition management in Linux.

Partition management in Linux (CentOS/Red Hat)

Generally, Window File Systems are FAT32, NTFS.

And, Linux file systems are ext2, ext3, ext4, XFS (current), vfat, swap, ZFS, GlusterFS.

All device files location: /dev/*

* hdd, dvd, cdrom, usb, serial, swap, tty

 

Total Partition: (MBR – Master Boot Record)- (sata) – BIOS

Linux Partition = 15 (4 Primary + 11 Logical)

Windows Partition: 24 C-Z, A- Floppy, B-zip

 

Total Partition: (GPT – which is stands for Guid Partition Table)- UEFI (which is stands for United Extensibel Firmware Interface)

Total Partition: 128

 

SATA/SCSI HDD is marked as sda, sdb, sdc

USB devices is considered in Linux as sda1, sdb1

DVD drivers are markes in Linux (CentOS) as dvd/sr0

So we want to see all partition, just type these command in CLI.

[root@ns1 Desktop]# fdisk -l

sda = 1st sata

sdb = 2nd stata

sdc = 3rd sata

Command to see Linux mounted partition(s)

[root@ns1 Desktop]# df -HT

 

/dev/sda6     xfs     52G   7.0G   43G   15% /

/dev/sda5     xfs     204M   27M   167M 14% /boot

 

[root@desktop1 /]# du -ch home

Partition ID of Linux:

NTFS – 7

Extended – 5

ext3/ext4/xfs – 83

swap – 82

LVM – 8e

vfat – f

RAID – fd

 

Now we want to create a new Partition. So we just’ll just type the command

[root@ns1 dev]# fdisk /dev/sda

 

Command (m for help): m

 

d   delete a partition

l   list known partition types

m   is for print this menu

n   is for adding a new partition

p   is to print the partition table

q   is to quit without saving changes

t  is for changing a partition’s system id

w   is to write table to disk and exit

 

Command (m for help): n

 

[root@ns1 Desktop]# fdisk /dev/sda

 

Command (m for help): n

First sector (415141888-976773119, default 415141888): {press Enter}

Using default value 415141888

Last sector, +sectors or +size{K,M,G} (415141888-976773119, default 976773119): +350M

 

Command (m for help): p

Command (m for help): w

 

Now if you want to update the partition table, just follow this command.

[root@desktop1 ~]# partprobe /dev/sda

 

Want to format a partition? Just follow the command:

[root@ns1 Desktop]# mkfs.xfs /dev/sdaX

 

Want to mount a partition?? Follow this:

[root@ns1 Desktop]# mkdir /data

[root@ns1 Desktop]# df -HT

[root@ns1 Desktop]# mount /dev/sda9 /data

 

[root@ns1 Desktop]# df -HT

[root@ns1 Desktop]# cd /data

[root@ns1 data]# ls

[root@ns1 data]# df -HT

Filesystem   Type     Size   Used Avail Use% Mounted on

/dev/sda6     xfs       16G   6.4G   8.4G 44% /

/dev/sda5     xfs     204M   27M   167M 14% /boot

/dev/sda9     xfs     508M   11M   471M   3% /data

[root@ns1 data]# cd ..       ; This command is going to the previous directory.

[root@ns1 /]# umount /data

[root@ns1 /]# df -HT

Filesystem   Type     Size   Used Avail Use% Mounted on

/dev/sda6     xfs       16G   6.4G   8.4G 44% /

tmpfs       tmpfs     2.0G   267k   2.0G   1% /dev/shm

/dev/sda5     xfs     204M   27M   167M 14% /boot

 

Permanent Mount:

[root@localhost ~]# blkid /dev/sda8

 

[root@ns1 ~]# vi /etc/fstab

 

UUID=1b42c7df-717a-420d-b054-81d5a48594b5   /data xfs   defaults 0 0

 

or

/dev/sda9   /data   xfs     defaults   0 0

 

1                         2              3         4       5 6

1 – partition

2 – mountpoint

3 – filesystem

4 – options(quota,acl)

5-6 – file system check options

 

[root@ns1 ~]# mount -a ;fstab file update

[root@ns1 ~]# df-HT ; view

 

Now, want to delete a partition?? Follow this:

[root@ns1 ~]# fdisk /dev/sda

 

Command (m for help): d

Partition number , generally there is displayed (1-10).

 

Command (m for help): p

Command (m for help): w

 

Note: Before delete, you should unmount partition and delete fstab entry.

 

[root@ns1 ~]# fdisk -l

 

Mount USB pen drive:

[root@ns1 Desktop]# fdisk -l

Disk /dev/sdb: 32.2 GB, 32176472064 bytes

[root@ns1 Desktop]# mount /dev/sdb1 /mnt

[root@ns1 mnt]# cd /mnt

[root@ns1 mnt]# ls

[root@ns1 mnt]# cp cv.docx /root/Desktop

[root@ns1 mnt]# cp /etc/passwd /mnt

[root@ns1 mnt]# cd

[root@ns1 ~]# umount /mnt

[root@ns1 ~]# cd /mnt

[root@ns1 mnt]# ls

 

Mount DVD:

[root@ns1 Desktop]# mount /dev/sr0 /media

[root@ns1 Desktop]# cd /media

[root@ns1 media]# ls

[root@ns1 media]# cd Packages

[root@ns1 Packages]# ls

[root@ns1 Packages]# cd

[root@ns1 ~]# umount /media

[root@ns1 ~]#

 

Screenshots for you:

Partition management in Linux (CentOS)

Partition management in Linux (CentOS)

Partition management in Linux (CentOS)

Partition management in Linux (CentOS)

May 31, 2016Himadri
 

Share with friends :

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to email a link to a friend (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to print (Opens in new window)

Related

Compression file folder in LinuxLinux process system discussion

Leave a Reply Cancel reply

seven + two =

Himadri

Hi, I'm Himadri. I love blogging with tech topics, specially computer networking. We'll have more fun in the upcoming day. Stay with me. :)

May 31, 2016 16 Comments Linux installation and server managementLinux cammand partition management, Partition management in CentOS Red Hat, partition management in Linux629
Feel Free to Share :)
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Find Us on Facebook
Choose a category !!
  • CCNA
  • Cisco Certification Exam
  • cisco packet tracer 6.2
  • Cisco packet tracer 6.3
  • Cisco Packet Tracer 7
  • Cisco Packet Tracer 7.1
  • Cisco Packet Tracer 7.2.1
  • Cisco Packet Tracer 7.3
  • Cyber Security
  • Engineering Ebooks
  • Excel
  • IELTS Ebook
  • Internet
  • Know computer
  • Know your computer
  • Laser Processing of Material
  • Linux installation and server management
  • PDF
  • Technology
  • Uncategorized
Top posts
  • Packet tracer 6.2 student version for Linux - Free download
  • Free download cisco packet tracer 6.3 for Linux, with tutorial version
  • Autonomous and light weight access point
Archieves
Get latest updates by Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 19 other subscribers
W
SC
wordpress counter
Analytics
Recent Comments
    Browse by categories
    Cyber SecurityLinux installation and server managementCCNAKnow your computerKnow computerCisco Packet Tracer 7UncategorizedCisco Certification ExamInternetPDFCisco Packet Tracer 7.3Engineering EbooksCisco packet tracer 6.3cisco packet tracer 6.2Cisco Packet Tracer 7.1TechnologyExcelLaser Processing of MaterialCisco Packet Tracer 7.2.1IELTS Ebook
    Feel free to contact with us

    Hi, any kind of comment or suggestion is valuable to us. So feel free to contact with us.

    Email: himadri.shekhar.bd@gmail.com

    Name: WhileNetworking.com

    2021 © WhileNetworking
     

    Loading Comments...