Linux storage architecture and disk partitioning

Source: Internet
Author: User
Tags disk usage

The main common catalog definitions

  1. /boot required files ---- kernel, boot menu and required configuration file

  2. /dev Any devices and interfaces are stored as files in this directory

  3. /etc configuration file

  4. / Home User Master directory

  5. /bin commands that can be manipulated in single-user maintenance mode

  6. /lib function libraries used when booting up and /bin and /sbin functions to be called by the following command

  7. /sbin required during boot- up

  8. /media devices that are generally mounted or removed

  9. /OPT placing third-party software

  10. /root system Administrator's home directory

  11. /tmp Shared temp directory for any person to use

  12. /var mainly stores frequently changing files, such as logs

Mounting hardware devices

Mount mounts File system "Mount/dev/cdroom/media/cdroom"

-A mount all file systems defined in/etc/fstab

-t Specifies the type of file system

Simulation Training: partition, format, and mount the new hard drive device to /newfs Catalogue

Step 1 : Add a hard disk to the virtual machine for the logical volume experiment

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/84/23/wKiom1eG53nRbhYDAAGv-2RyIk0495.png "title=" Qq20160713111053.png "alt=" Wkiom1eg53nrbhydaagv-2ryik0495.png "/>

Step 2 : Select disk

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/23/wKiom1eG55HxfjMdAAGNVUwNG88066.png "title=" Qq20160713111120.png "alt=" Wkiom1eg55hxfjmdaagnvuwng88066.png "/>

Step 3: Select a disk type

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/84/23/wKiom1eG56vROnvyAAFNR3QBvFY200.png "title=" Qq20160713111130.png "alt=" Wkiom1eg56vronvyaafnr3qbvfy200.png "/>

Step 4 : Choose to create a new disk

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/84/23/wKioL1eG58yRdXIiAAGsgByDLZo837.png "title=" Qq20160713111139.png "alt=" Wkiol1eg58yrdxiiaagsgbydlzo837.png "/>

Section 5 Step: Set the size of the disk

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/84/23/wKiom1eG5_OwMbfYAAF5X0G9fr8483.png "title=" Qq20160713111149.png "alt=" Wkiom1eg5_owmbfyaaf5x0g9fr8483.png "/>

Step 6 : The default disk name can be


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/84/23/wKioL1eG6AqSLysuAAE7_z38No0331.png "title=" Qq20160713111157.png "alt=" Wkiol1eg6aqslysuaae7_z38no0331.png "/>

Step 7 : The successfully added hard drive appears in the list

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/23/wKiom1eG6D6Qv71yAAFiLfq2QoI247.png "title=" Qq20160713111207.png "alt=" Wkiom1eg6d6qv71yaafilfq2qoi247.png "/>

Step Two: Partition the newly added hard disk

Fdisk for managing disk partitions

manage partitions for a hard disk:FDISK/DEV/SDA

M View all available parameters

N add a new partition

d Delete a partition information

L list all available partition types

T change the type of a partition

P View information for partitioned tables

W Save Exit

Q do not save direct exit

To partition a SDB hard disk using the fdisk command

#fdisk/dev/sdb

Command (M for help):p------> View partition information

Command (M for help): n------> Create new Partition

Partition Type:

P:

E:

Select (defaults p):p

tapping the number 1 represents the partition number 1:

Partition number (1–4,default 1): 1

Start sector of the disk, enter directly:

Frist sector (2048–41943039,default 20148) +2g

Tap the character Wto save the above partition information:

Step 3 : Format The XFS file system

#mkf. xfs/dev/sdb1

Step 4 : Mount the hard drive device to the /newfs directory

#Mkdir/newfs

#mount/dev/sdb1/newfs

Step 5 : Set the system to automatically mount the hard drive device after booting

#vim/etc/fstab

/DEV/SDB1/NEWFSXFS Defaults 0 0

Step 6 : View the file system situation:

DF is used to view mount point information and disk usage

-a displays all file systems ( including virtual )

-H easier-to-read capacity format

-I show the Inode information

View all mounted mount information and hard disk usage

#df-H

Du is used to see how much disk is being used

View the space occupied by each file in the root directory

#du-H

Linux storage architecture and disk partitioning

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.