Linux 服务器挂载盘阵(运维工程师必备技能难度***)

以下为真实操作过程

[root@dg1 ~]# fdisk -l -u

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845    62910539    31350847+  8e  Linux LVM

Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders, total 6291456 sectors
Units = sectors of 1 * 512 = 512 bytes

Disk /dev/sdb doesn't contain a valid partition table


[root@dg1 ~]# df -ah

文件系统              容量  已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
                       22G   18G  2.9G  87% /
proc                     0     0     0   -  /proc
sysfs                    0     0     0   -  /sys
devpts                   0     0     0   -  /dev/pts
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                 2.9G  1.4G  1.5G  48% /dev/shm
none                     0     0     0   -  /proc/sys/fs/binfmt_misc
sunrpc                   0     0     0   -  /var/lib/nfs/rpc_pipefs

[root@dg1 ~]# fdisk -u /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. 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)

Command (m for help): m
Command 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)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-6291455, default 63): 
Using default value 63
Last sector or +size or +sizeM or +sizeK (63-6291455, default 6291455): 
Using default value 6291455

Command (m for help): m
Command 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)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@dg1 ~]# fdisk -ul

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845    62910539    31350847+  8e  Linux LVM

Disk /dev/sdb: 3221 MB, 3221225472 bytes
160 heads, 24 sectors/track, 1638 cylinders, total 6291456 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63     6291455     3145696+  83  Linux

[root@dg1 ~]# ll /dev/sd*

brw-r----- 1 root disk 8,  0 06-05 11:07 /dev/sda
brw-r----- 1 root disk 8,  1 06-05 11:07 /dev/sda1
brw-r----- 1 root disk 8,  2 06-05 11:07 /dev/sda2
brw-r----- 1 root disk 8, 16 06-05 11:14 /dev/sdb
brw-r----- 1 root disk 8, 17 06-05 11:15 /dev/sdb1
brw-r----- 1 root disk 8, 18 06-05 11:16 /dev/sdb2
brw-r----- 1 root disk 8, 19 06-05 11:16 /dev/sdb3
brw-r----- 1 root disk 8, 20 06-05 11:16 /dev/sdb4


[root@dg1 ~]# df -ah

文件系统              容量  已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
                       22G   18G  2.9G  87% /
proc                     0     0     0   -  /proc
sysfs                    0     0     0   -  /sys
devpts                   0     0     0   -  /dev/pts
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                 2.9G  1.4G  1.5G  48% /dev/shm
none                     0     0     0   -  /proc/sys/fs/binfmt_misc
sunrpc                   0     0     0   -  /var/lib/nfs/rpc_pipefs


[root@dg1 ~]# fdisk -ul

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845    62910539    31350847+  8e  Linux LVM

Disk /dev/sdb: 3221 MB, 3221225472 bytes
160 heads, 24 sectors/track, 1638 cylinders, total 6291456 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63     6291455     3145696+  83  Linux


[root@dg1 ~]# mkfs.ext3 /dev/sdb1

mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
393216 inodes, 786424 blocks
39321 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=805306368
24 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912

Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


[root@dg1 ~]# df -ah

文件系统              容量  已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
                       22G   18G  2.9G  87% /
proc                     0     0     0   -  /proc
sysfs                    0     0     0   -  /sys
devpts                   0     0     0   -  /dev/pts
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                 2.9G  1.4G  1.5G  48% /dev/shm
none                     0     0     0   -  /proc/sys/fs/binfmt_misc
sunrpc                   0     0     0   -  /var/lib/nfs/rpc_pipefs

[root@dg1 ~]# fdisk -lu

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845    62910539    31350847+  8e  Linux LVM

Disk /dev/sdb: 3221 MB, 3221225472 bytes
160 heads, 24 sectors/track, 1638 cylinders, total 6291456 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63     6291455     3145696+  83  Linux

[root@dg1 ~]# mkdir /oa
[root@dg1 ~]# cd /oa
[root@dg1 oa]# touch oa.sh
[root@dg1 oa]# cd ..
[root@dg1 /]# mount /dev/sdb1 /oa
[root@dg1 /]# df -a -Th

文件系统      类型    容量  已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
              ext3     22G   18G  2.9G  87% /
proc          proc       0     0     0   -  /proc
sysfs        sysfs       0     0     0   -  /sys
devpts      devpts       0     0     0   -  /dev/pts
/dev/sda1     ext3     99M   13M   82M  14% /boot
tmpfs        tmpfs    2.9G  1.4G  1.5G  48% /dev/shm
none   binfmt_misc       0     0     0   -  /proc/sys/fs/binfmt_misc
sunrpc  rpc_pipefs       0     0     0   -  /var/lib/nfs/rpc_pipefs
/dev/sdb1     ext3    3.0G   69M  2.8G   3% /oa


 

相关推荐

  1. Linux 配置安装ftp 工程师必备技能难度***

    2024-03-13 13:12:01       48 阅读
  2. LinuxLinux必备:groupdel命令的使用方法

    2024-03-13 13:12:01       60 阅读
  3. window 挂载linux

    2024-03-13 13:12:01       55 阅读
  4. Linux工程师基础面试题整理(一)

    2024-03-13 13:12:01       26 阅读
  5. Liunx批量启动、停止服务

    2024-03-13 13:12:01       65 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-13 13:12:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-13 13:12:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-13 13:12:01       82 阅读
  4. Python语言-面向对象

    2024-03-13 13:12:01       91 阅读

热门阅读

  1. 使用Docker搭建Jellyfin

    2024-03-13 13:12:01       61 阅读
  2. 设计一个生产制造系统100问?

    2024-03-13 13:12:01       36 阅读
  3. Linux异步通知简介

    2024-03-13 13:12:01       49 阅读
  4. Linux无分区表

    2024-03-13 13:12:01       48 阅读
  5. ceph 换盘扩容

    2024-03-13 13:12:01       42 阅读
  6. pinia和vuex区别?

    2024-03-13 13:12:01       39 阅读
  7. mysql备份和还原全部的数据库

    2024-03-13 13:12:01       37 阅读
  8. 01背包与完全背包

    2024-03-13 13:12:01       41 阅读
  9. 动态规划介绍和示例

    2024-03-13 13:12:01       40 阅读
  10. MYSQL------从概述到DQL

    2024-03-13 13:12:01       33 阅读
  11. JVM-1

    JVM-1

    2024-03-13 13:12:01      39 阅读
  12. Android 子线程为什么不能更新UI?

    2024-03-13 13:12:01       37 阅读