RedHatLinux disk partitioning, formatting, attaching, and detaching

Source: Internet
Author: User

RedHatLinux disk partitioning, formatting, attaching, and detaching

[Root @ CORPSE2010/] # fdisk-lDisk/dev/sda: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cylindersUnits = cylinders of 16065*512 = 8225280 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal): 512 bytes/512 bytesDisk identifier: 0x00097ff5Device Boot Start End Blocks Id System/dev/sda1 * 1 26 204800 83 LinuxPartition 1 does not end on cylinder bo Undary. /dev/sda2 26 28072 225280000 83 Linux/dev/sda3 28072 32152 32768000 82 Linux swap/Solaris/dev/sda4 32152 39163 56318976 5 Extended/dev/sda5 32152 33427 83 Linux/ dev/sda6 33427 34702 10240000 83 Linux/dev/sda7 34702 35976 10240000 83 Linux/dev/sda8 35977 39163 25594880 83 LinuxDisk/dev/sdb: 32.2 GB, 32212254720 bytes ---------- unmounted 64 heads, 32 sectors/track, 30720 cylindersUnits = Cylinders of 2048*512 = 1048576 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal): 512 bytes/512 bytesDisk identifier: 0x00000000 [root @ CORPSE2010: WEIHU] # fdisk/dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0x810d5e15. changes will remain in memory only, until you de Cide 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 stronugly recommended toswitch off the mode (command 'C') and change display units tosectors (command 'U '). command (m for help): mCommand actiona toggle a bootable flagb edit bsd disklabelc Toggle the dos compatibility flagd delete a previous list known partition typesm print this menun add a new partition create a new empty DOS partition tablep print the partition tableq quit without saving changess create a new empty Sun created change a partition's system idu change display/entry unitsv verify the partition tablew write table to disk and exitx extra functionality (experts on Ly) Command (m for help): nCommand actione extendedp primary partition (1-4) 1 Invalid partition number for type '1' Command actione extendedp primary partition (1-4) pPartition number (1-4): 1 First cylinder (1-30720, default 1): Using default value 1 Last cylinder, + cylinders or + size {K, M, g} (1-30720, default 30720): Using default value 30720 Command (m for help): pDisk/dev/sdb: 32.2 GB, 32212254720 bytes S64 heads, 32 sectors/track, 30720 cylindersUnits = cylinders of 2048*512 = 1048576 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal ): 512 bytes/512 bytesDisk identifier: 0x810d5e15Device Boot Start End Blocks Id System/dev/sdb1 1 30720 31457264 83 Linux --- ext4 partition, ID 83 Command (m for help ): wThe partition table has been altered! Calling ioctl () to re-read partition table. syncing disks. [root @ CORPSE2010: WEIHU] # partprobe/dev/sdb [root @ CORPSE2010: WEIHU] # mkfs-V-t ext4-c/dev/sdb1mkfs (util-linux-ng 2.17.2) mkfs. ext4-c/dev/sdb1mke2fs 1.41.12: linux Kernel kernel 4096 (log = 2) kernel = 4096 (log = 2) Stride = 0 blocks, Stripe width = 0 blocks1966080 inodes, 7864316 blocks393215 blocks (5.00%) reserved for the super user Login Juan Quan = 0 Maximum filesystem blocks = 4294967296240 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768,983 04, 163840,229 376, 294912,819 200, 884736,160 5632, 2654208,4096000 Checking for bad blocks (read-only test ): too many threads have been written into the Creating journal (32768 blocks): too many threads Writing superblocks and filesystem accounting information: please wait until This filesystem will be automatically checked every 32 mounts or180 days, whichever comes first. use tune2fs-c or-I to override. [root @ CORPSE2010: WEIHU] # mkdir/mnt/sdb1 [root @ CORPSE2010: WEIHU] # mount/dev/sdb1/mnt/sdb1 [root @ CORPSE2010: WEIHU] # df-ThFilesystem Type Size Used Avail Use % Mounted on/dev/sda5 ext4 9.5G 5.7G 3.4G 64%/tmpfs 16G 72 K 16G 1%/dev/shm /dev/sda1 ext4 190 M 34 M 146 M 19%/boot/dev/sda8 ext4 24G 44 M 23G 1%/data/dev/sda2 ext4 212G 4.0G 197G 2% /home/dev/sda6 ext4 9.5G 576 M 8.5G 7%/opt/dev/sda7 ext4 9.5G 227 M 8.8G 3%/var/dev/sdb1 ext4 30G 44 M 28G 1%/mnt/sdb1 [root @ CORPSE2010: WEIHU] # more/etc/fstab # Created by anaconda on Fri May 8 17:04:47 2015 # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab (5), findfs (8), mount (8) and/or blkid (8) for more info # UUID = users/ext4 defaults 1 1 UUID = users/boot ext4 defaults 1 2 UUID = users/data ext4 defaults 1 2 UUID = users/home ext4 defaults 1 2 UUID = b5a201c2-8b44-4194-96fa-adebe93c9a9f/opt ext4 defaults 1 2 UUID = f4734300-3968-4560-8f1d-9f9b4ef51ea7/var ext4 defaults 1 2 UUID = swap defaults 0 0 tmpfs/dev/shm tmpfs defaults 0 0 devpts/dev/pts devpts gid = 5, mode = 620 0 0 sysfs/sys sysfs defaults 0 0 proc/proc defaults 0 0 [root @ CORPSE2010: WEIHU] # df-lhFilesystem Size Used Avail Use % Mounted on/dev/sda5 9.5G 5.7G 3.4G 64%/tmpfs 16G 72 K 16G 1%/dev/shm/dev/ sda1 190 M 34 M 146 M 19%/boot/dev/sda8 24G 44 M 23G 1%/data/dev/sda2 212G 4.0G 197G 2%/home/dev/sda6 9.5G 576 M 8.5G 7%/opt/dev/sda7 9.5G 227 M 8.8G 3%/var/dev/sdb1 30G 44 M 28G 1%/mnt/sdb1 [root @ CORPSE2010: WEIHU] # [root @ CORPSE2010: WEIHU] # umount/dev/sdb1 ---- uninstall [root @ CORPSE2010: WEIHU] # [root @ CORPSE2010: WEIHU] # [root @ CORPSE2010: WEIHU] # [root @ CORPSE2010: WEIHU] # df-lhFilesystem Size Used Avail Use % Mounted on/dev/sda5 9.5G 5.7G 3.4G 64%/tmpfs 16G 72 K 16G 1%/dev/shm/dev/ sda1 190 M 34 M 146 M 19%/boot/dev/sda8 24G 44 M 23G 1%/data/dev/sda2 212G 4.0G 197G 2%/home/dev/sda6 9.5G 576 M 8.5G 7%/opt/dev/sda7 9.5G 227 M 8.8G 3%/var

 

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.