In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Blog Directory
I. Disk basics
1. Disk structure
Second, disk partition representation
1. Disk partition structure
2. File system type
Third, planning hard disk partition
1. Detect and confirm the new hard disk
2. Planning partitions in the hard disk
1. Disk basics 1. Disk structure
Hard disk storage capacity = number of heads x number of tracks (cylinders) x number of sectors per track x number of bytes per sector
cylinders/heads/sectors can be used to uniquely locate each area on the disk 1) physical structure of the hard disk
Disk: hard disk has multiple disks, each disk 2 sides;
magnetic head: one magnetic head per side;2) data structure of hard disk
Sectors: The disk is divided into sectors, each sector storing 512 bytes of data;
Track: concentric circles of different radii on the same disk;
Cylinder: cylindrical surface composed of different disks with the same radius;3) disk interface type
IDE (parallel mouth): basically eliminated;
SATA (serial port): fast speed, strong error correction ability, current mainstream interface, widely used;
SCSI: fast speed, low CPU resource consumption, support hot plug;4) MBR master boot record
MBR (Master Boot Record) is located in the first physical sector of the hard disk;MBR contains the main boot program of the hard disk and the partition table of the hard disk; the partition table has 4 partition records, each partition record area occupies 16 bytes.
Second, disk partition representation
Linux will be hard disk, partition and other devices are represented as files.
IDE: /dev/hda5, the serial number of the hard disk is represented by a~z, the serial number of the partition is represented by a number, 1~4 is represented as the primary partition, and after 5 is represented as the logical partition. The computer has a total of two IDE interface disks.
SATA, SCSI: /dev/sdb2, a computer with a total of three SATA or SCSI hard disks.
Examples of applications are as follows:
1. Disk partition structure
There are only four primary partitions in the hard disk, so the number of primary partitions and extended partitions is limited to 1~4, and the extended partitions are subdivided into logical partitions, and the number of logical partitions will always start from 5. As shown below:
File system type 1) XFS file system
Partitions for file and directory data, high-performance journaled file systems, default file systems used in CentOS 7.
2) SWAP Exchange File System
Create swap partitions for Linux systems.
3) EXT4 Generation 4 Extended File System
Partitions for storing file and directory data, typically journaled file systems, file systems used by default in the system.
Other file system types supported by Linux
FAT16、FAT32、NTFS、XFS、JFS......
Third, planning hard disk partition 1, detect and confirm the new hard disk 1) detect and confirm the basic syntax format of the new hard disk is as follows:
The output message description is as follows:
Examples of applications are as follows (List information about all hard disk devices and their partitions in the current system):[root@centos01 ~]# fdisk -l Disk/dev/sda: 85.9 GB, 85899345920 bytes, 167772160 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes/ 512 bytes I/O size (minimum/optimal): 512 bytes/ 512 bytes disk label type: dos disk identifier: 0x000 ab7bb Device Boot Start End Blocks Id System/dev/sda1 * 2048 411647 204800 83 Linux/dev/sda2 411648 8800255 4194304 82 Linux swap / Solaris/dev/sda3 8800256 167772159 79485952 83 Linux disk/dev/sdb: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes/ 512 bytes I/O size (minimum/optimal): 512 bytes/ 512 bytes 2. Planning partitions in a hard disk 1) Planning the role and syntax of hard disk partitions
The basic syntax used to manage disk partitions in an interactive operating environment is as follows:
2) Examples of applications are as follows: [root@centos01 ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.23.2). The changes stay in memory until you decide to write them to disk. Think twice before using the write command. Command (enter m for help): m command operation a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition g create a new empty GPT partition table G create an IRIX (SGI) partition table l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (excents only)3) Common directives in fdisk interaction mode
m: View help information for operation instructions;
p: List to view partition information;
n: New partition;
d: Delete partition;
t: Change partition type;
w: Save partition settings and exit;
q: Abandon partition settings and exit;3) Plan partition cases in hard disk
Add a new 40GB SCSI hard drive to the host;
Divide the hard disk into three main partitions, each of which is 5GB;
The remaining space is extended partition; 2 logical partitions are established in the extended partition, with capacities of 5GB and 10GB respectively;
Change the type of the first logical partition to swap and the type of the second logical partition to lvm volumes;
Confirm partition settings, save and exit;
The case application is as follows:
[root@centos01 ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.23.2). The changes stay in memory until you decide to write them to disk. Think twice before using the write command. Command (enter m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): p Partition number (1-4, default 1): Starting sector (2048-83886079, default 2048): The default value of 2048Last sector, + sector or +size{K,M,G} will be used (2048-83886079, default is 83886079):+5G Partition 1 is set to Linux type and size 5 GiB command (enter m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (2-4, default 2): Starting sector (10487808-83886079, default 10487808): The default value of 10487808Last sector, + sector or +size{K,M,G} will be used (10487808-83886079, default is 83886079):+5G Partition 2 has been set to Linux type and size 5 GiB command (enter m for help): p primary (2 primary, 0 extended, 2 free) e extendedSelect (default p): p Partition number (3,4, default 3): Starting sector (20973568-83886079, default 20973568): default 20973568 will be used Last sector, + sector or +size{K,M,G} (20973568-83886079, default 83886079):+5G Partition 3 is set to Linux type and size 5 GiB command (enter m for help): n Partition type: p primary (3 primary, 0 extended, 1 free) e extendedSelect (default e): e Selected partition 4 starting sector (31459328-83886079, default 31459328): default 31459328Last sector, + sector or +size{K,M,G} (31459328-83886079, default 83886079) will be used: will use default 83886079 Partition 4 is set to Extended type and size 25 GiB command (enter m for help): n All primary partitions are in use Add logical partition 5 starting sector (31461376-83886079, default 31461376): The default value 31461376Last sector, + sector or +size{K,M,G} will be used (31461376-83886079, default 83886079):+5G Partition 5 is set to Linux type and size 5 GiB command (enter m for help): n All primary partitions are in use Add logical partition 6 starting sector (41949184-83886079, default 41949184): Default 41949184Last sector, + sector or +size{K,M,G} will be used (41949184-83886079, default 83886079):+10G Partition 6 is set to Linux type and size 10 GiB command (enter m for help): t Partition number (1-6, default 6): 5 Hex codes (enter L to list all codes): 82 Changed the type of partition "Linux" to "Linux swap / Solaris" command (enter m for help): t Partition number (1-6, default 6): 6 Hex codes (enter L to list all codes): 8e Changed partition type "Linux" to "Linux LVM" command (enter m for help): p Disk/dev/sdb: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes/ 512 bytes I/O size (minimum/optimal): 512 bytes/ 512 bytes Disk label type: dos Disk identifier: 0xd91b1f6f Device Boot Start End Blocks Id System/dev/sdb1 2048 10487807 5242880 83 Linux/dev/sdb2 10487808 20973567 5242880 83 Linux/dev/sdb3 20973568 31459327 5242880 83 Linux/dev/sdb4 31459328 83886079 26213376 5 Extended/dev/sdb5 31461376 41947135 5242880 82 Linux swap / Solaris/dev/sdb6 41949184 62920703 10485760 8e Linux LVM command (enter m for help): w The partition table has been altered! Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.The kernel still uses the old table. The new table will be used atthe next reboot or after you run partprobe(8) or kpartx(8) Synchronizing disks.
--------This article ends here, thanks for reading-------
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.