In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces linux how to add hard disk partition mount, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Basic steps: partition-format-mount-write file
1. First use the fdisk-l command to check the name of the added hard disk, and you can see that sdb is the newly added hard disk.
[root@oracle] # fdisk-lDisk / dev/sdb: 21.5GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk / dev/sda: 21.5GB, 21474836480 bytes255 heads, 63 sectors/track 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0006b59cDevice Boot Start End Blocks Id System/dev/sda1 * 1 39 307200 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2 39 2358 83 Linux/dev/sda3 2358 2611 2031616 82 Linux swap / Solaris
2. Partition, enter m to view the prompt
[root@oracle] # fdisk / dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0x09f38795.Changes will remain in memory only, until you decide to write them.After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): mCommand action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition 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 (experts only)
Analysis: analysis of main parameters
1. Enter m to display all command lists.
two。 Enter p to display the hard disk partition and print the partition table.
3. Enter a to set the hard drive boot area.
4. Enter n to create a new hard disk partition.
4.1. Enter the e hard disk as a [extended] partition (extend).
4.2. Enter p hard disk as the [main] partition (primary).
5. Enter t to change the partition properties of the hard disk.
T: partition system id number
L:82:linux swap
83:linux
86:NTFS window partition
6. Enter d to delete the hard disk partition properties.
7. Enter Q to finish not saving the hard disk partition attribute.
8. Enter w to end and write the hard disk partition attribute
3. Enter n to create a new hard disk partition-- enter p to create a primary partition-- enter 1 to set a partition-- enter-enter-enter (default full space)
Command (m for help): nCommand action e extended extended Partition p primary partition (1-4) Primary Partition pPartition number (1-4): 1First cylinder (1-2610, default 1): Using default value 1Last cylinder, + cylinders or + size {K Magi M Magi G} (1-2610, default 2610): Using default value 2610
4. Enter p to view the partition-enter w to save and exit (be sure to save it or it will not work)
Command (m for help): P Disk / dev/sdb: 21.5GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x09f38795 Device Boot Start End Blocks Id System/dev/sdb1 12610 20964793 + 83 Linux Command (m for help): wThe partition table has been altered! Calling ioctl () to re-read partition table.Syncing disks.
5. The mkfs command formats the disk
[root@oracle ~] # mkfs.ext4 / dev/sdbmkfs.ext4: invalid fragment size-/ dev/sdb
6. Mount command mounts the partition
[root@oracle ~] # mount / dev/sdb / oracle/You have new mail in / var/spool/mail/root [root@oracle ~] # df-THFilesystem Type Size Used Avail Use% Mounted on/dev/sda2 ext4 19G 11G 7.3G% / tmpfs tmpfs 2.1G 74k 2.1G 1% / dev/shm/dev/sda1 ext4 297M 29M 253M 11% / boot/dev/sdb ext4 22G 47M 20G 1% / oracle
7. Add to / etc/fstab file, save and exit, otherwise the hard disk disappears after reboot.
/ dev/sdb / oracle ext4 defaults,noatime 00 Thank you for reading this article carefully. I hope the article "how to add hard disk partitions and mount linux" shared by the editor will be helpful to you. At the same time, I also hope you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!
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.