리눅스 시스템 Mount 와 Partitioning

Jake Lee·2022년 11월 22일

리눅스시스템

목록 보기
8/9

1. mount

mount -t [파일시스템명] [장치명] [마운트할경로]

  • 모든 disk, printer 등의 장치는 mount 하여야만 사용 가능하다.

  • 현재 mount된 파일시스템을 볼려면 df명령을 사용한다.

  • 부팅시 자동으로 mount하게 하려면 /etc/fstab에 등록해야한다.


  • ex) TESTCD.iso를 /iso-test에 mount 및 unmount 하기

[root@localhost ~]# df
Filesystem          1K-blocks    Used Available Use% Mounted on
devtmpfs               463696       0    463696   0% /dev
tmpfs                  493944       0    493944   0% /dev/shm
tmpfs                  493944    7036    486908   2% /run
tmpfs                  493944       0    493944   0% /sys/fs/cgroup
/dev/mapper/cs-root  14034944 5397892   8637052  39% /
/dev/sda1             1038336  237208    801128  23% /boot
tmpfs                   98788       0     98788   0% /run/user/0


[root@localhost ~]# mkdir iso-test

[root@localhost ~]# mount -t iso9660 TestCD.iso iso-test
mount: /root/iso-test: WARNING: device write-protected, mounted read-only.

[root@localhost ~]# df
Filesystem          1K-blocks    Used Available Use% Mounted on
devtmpfs               463696       0    463696   0% /dev
tmpfs                  493944       0    493944   0% /dev/shm
tmpfs                  493944    7048    486896   2% /run
tmpfs                  493944       0    493944   0% /sys/fs/cgroup
/dev/mapper/cs-root  14034944 5525488   8509456  40% /
/dev/sda1             1038336  237208    801128  23% /boot
tmpfs                   98788       0     98788   0% /run/user/0
/dev/loop0             127674  127674         0 100% /root/iso-test

[root@localhost ~]# umount iso-test

2. Partitioning(fdisk)

fdisk [장치명]

  • fdisk는 파티셔닝을 관장하는 프로그램이다.

  • 주파티션은 4개까지 가능하며, disk를 4개 이상의 파티션으로 나눌려면 주파티션 중 하나를 extended partition으로 바꾸고 그 속에 여러 개의 logical partition을 잡는다.

  • lsblk명령을 이용해 현재 디스크의 파티셔닝/마운트 정보를 확인할 수 있다.


  • ex1) 부트디스크인 /dev/sda의 파티셔닝 정보와 fdisk 명령을 알아보기

[root@localhost ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   16G  0 disk 
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   15G  0 part 
  ├─cs-root 253:0    0 13.4G  0 lvm  /
  └─cs-swap 253:1    0  1.6G  0 lvm  [SWAP]
sdb           8:16   0   16G  0 disk 
sdc           8:32   0   16G  0 disk 
sr0          11:0    1 1024M  0 rom  

[root@localhost ~]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0x2563401c

Device     Boot   Start      End  Sectors Size Id Type
/dev/sda1  *       2048  2099199  2097152   1G 83 Linux
/dev/sda2       2099200 33554431 31455232  15G 8e Linux LVM

Command (m for help): m

Help:

  DOS (MBR)
   a   toggle a bootable flag
   b   edit nested BSD disklabel
   c   toggle the dos compatibility flag

  Generic
   d   delete a partition
   F   list free unpartitioned space
   l   list known partition types
   n   add a new partition
   p   print the partition table
   t   change a partition type
   v   verify the partition table
   i   print information about a partition

  Misc
   m   print this menu
   u   change display/entry units
   x   extra functionality (experts only)

  Script
   I   load disk layout from sfdisk script file
   O   dump disk layout to sfdisk script file

  Save & Exit
   w   write table to disk and exit
   q   quit without saving changes

  Create a new label
   g   create a new empty GPT partition table
   G   create a new empty SGI (IRIX) partition table
   o   create a new empty DOS partition table
   s   create a new empty Sun partition table


Command (m for help): q

  • ex2) /dev/sdb를 7개의 파티션으로 나누고 포매팅을 한 후, 각각 폴더에 mounting 하기

[root@localhost ~]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xd3d3b6e7.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-33554431, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-33554431, default 33554431): ^[[A^[[A^[[A^[[A^[[A^[[A^[[A+1G
Last sector, +sectors or +size{K,M,G,T,P} (2048-33554431, default 33554431): +1G

Created a new partition 1 of type 'Linux' and of size 1 GiB.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot Start     End Sectors Size Id Type
/dev/sdb1        2048 2099199 2097152   1G 83 Linux

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2099200-33554431, default 2099200): 
Last sector, +sectors or +size{K,M,G,T,P} (2099200-33554431, default 33554431): 

Created a new partition 2 of type 'Linux' and of size 15 GiB.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot   Start      End  Sectors Size Id Type
/dev/sdb1          2048  2099199  2097152   1G 83 Linux
/dev/sdb2       2099200 33554431 31455232  15G 83 Linux

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (2-4, default 2): 
First sector (2099200-33554431, default 2099200): 
Last sector, +sectors or +size{K,M,G,T,P} (2099200-33554431, default 33554431): +1G

Created a new partition 2 of type 'Linux' and of size 1 GiB.

Command (m for help): n
Partition type
   p   primary (2 primary, 0 extended, 2 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (3,4, default 3): 
First sector (4196352-33554431, default 4196352): 
Last sector, +sectors or +size{K,M,G,T,P} (4196352-33554431, default 33554431): +1G

Created a new partition 3 of type 'Linux' and of size 1 GiB.

Command (m for help): n
Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): p

Selected partition 4
First sector (6293504-33554431, default 6293504): 
Last sector, +sectors or +size{K,M,G,T,P} (6293504-33554431, default 33554431): 

Created a new partition 4 of type 'Linux' and of size 13 GiB.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot   Start      End  Sectors Size Id Type
/dev/sdb1          2048  2099199  2097152   1G 83 Linux
/dev/sdb2       2099200  4196351  2097152   1G 83 Linux
/dev/sdb3       4196352  6293503  2097152   1G 83 Linux
/dev/sdb4       6293504 33554431 27260928  13G 83 Linux

Command (m for help): d
Partition number (1-4, default 4): 4

Partition 4 has been deleted.

Command (m for help): d
Partition number (1-3, default 3): 3

Partition 3 has been deleted.

Command (m for help): n
Partition type
   p   primary (2 primary, 0 extended, 2 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (3,4, default 3): 
First sector (4196352-33554431, default 4196352): 
Last sector, +sectors or +size{K,M,G,T,P} (4196352-33554431, default 33554431): +2G

Created a new partition 3 of type 'Linux' and of size 2 GiB.

Command (m for help): 


Command (m for help): p

Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot   Start     End Sectors Size Id Type
/dev/sdb1          2048 2099199 2097152   1G 83 Linux
/dev/sdb2       2099200 4196351 2097152   1G 83 Linux
/dev/sdb3       4196352 8390655 4194304   2G 83 Linux

Command (m for help): n
Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): 

Using default response e.
Selected partition 4
First sector (8390656-33554431, default 8390656): 
Last sector, +sectors or +size{K,M,G,T,P} (8390656-33554431, default 33554431): 

Created a new partition 4 of type 'Extended' and of size 12 GiB.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot   Start      End  Sectors Size Id Type
/dev/sdb1          2048  2099199  2097152   1G 83 Linux
/dev/sdb2       2099200  4196351  2097152   1G 83 Linux
/dev/sdb3       4196352  8390655  4194304   2G 83 Linux
/dev/sdb4       8390656 33554431 25163776  12G  5 Extended

Command (m for help): n
All primary partitions are in use.
Adding logical partition 5
First sector (8392704-33554431, default 8392704): 
Last sector, +sectors or +size{K,M,G,T,P} (8392704-33554431, default 33554431): +2G

Created a new partition 5 of type 'Linux' and of size 2 GiB.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot   Start      End  Sectors Size Id Type
/dev/sdb1          2048  2099199  2097152   1G 83 Linux
/dev/sdb2       2099200  4196351  2097152   1G 83 Linux
/dev/sdb3       4196352  8390655  4194304   2G 83 Linux
/dev/sdb4       8390656 33554431 25163776  12G  5 Extended
/dev/sdb5       8392704 12587007  4194304   2G 83 Linux

Command (m for help): nnn^H^H
All primary partitions are in use.
Adding logical partition 6
First sector (12589056-33554431, default 12589056): 
Last sector, +sectors or +size{K,M,G,T,P} (12589056-33554431, default 33554431): +G^H1G
Last sector, +sectors or +size{K,M,G,T,P} (12589056-33554431, default 33554431): +1G

Created a new partition 6 of type 'Linux' and of size 1 GiB.

Command (m for help): nn
All primary partitions are in use.
Adding logical partition 7
First sector (14688256-33554431, default 14688256): 
Last sector, +sectors or +size{K,M,G,T,P} (14688256-33554431, default 33554431): +11^H
Last sector, +sectors or +size{K,M,G,T,P} (14688256-33554431, default 33554431): +1G

Created a new partition 7 of type 'Linux' and of size 1 GiB.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048  2099199  2097152   1G 83 Linux
/dev/sdb2        2099200  4196351  2097152   1G 83 Linux
/dev/sdb3        4196352  8390655  4194304   2G 83 Linux
/dev/sdb4        8390656 33554431 25163776  12G  5 Extended
/dev/sdb5        8392704 12587007  4194304   2G 83 Linux
/dev/sdb6       12589056 14686207  2097152   1G 83 Linux
/dev/sdb7       14688256 16785407  2097152   1G 83 Linux

Command (m for help): n
All primary partitions are in use.
Adding logical partition 8
First sector (16787456-33554431, default 16787456): 
Last sector, +sectors or +size{K,M,G,T,P} (16787456-33554431, default 33554431): 

Created a new partition 8 of type 'Linux' and of size 8 GiB.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048  2099199  2097152   1G 83 Linux
/dev/sdb2        2099200  4196351  2097152   1G 83 Linux
/dev/sdb3        4196352  8390655  4194304   2G 83 Linux
/dev/sdb4        8390656 33554431 25163776  12G  5 Extended
/dev/sdb5        8392704 12587007  4194304   2G 83 Linux
/dev/sdb6       12589056 14686207  2097152   1G 83 Linux
/dev/sdb7       14688256 16785407  2097152   1G 83 Linux
/dev/sdb8       16787456 33554431 16766976   8G 83 Linux

Command (m for help): t
Partition number (1-8, default 8): 5
Hex code (type L to list all codes): L

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden or  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx         
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access     
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O        
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor      
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi ea  Rufus alignment
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         eb  BeOS fs        
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ee  GPT            
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f1  SpeedStor      
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f4  SpeedStor      
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      f2  DOS secondary  
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fb  VMware VMFS    
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fc  VMware VMKCORE 
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fd  Linux raid auto
1c  Hidden W95 FAT3 75  PC/IX           bc  Acronis FAT32 L fe  LANstep        
1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot    ff  BBT            
Hex code (type L to list all codes): 7

Changed type of partition 'Linux' to 'HPFS/NTFS/exFAT'.

Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048  2099199  2097152   1G 83 Linux
/dev/sdb2        2099200  4196351  2097152   1G 83 Linux
/dev/sdb3        4196352  8390655  4194304   2G 83 Linux
/dev/sdb4        8390656 33554431 25163776  12G  5 Extended
/dev/sdb5        8392704 12587007  4194304   2G  7 HPFS/NTFS/exFAT
/dev/sdb6       12589056 14686207  2097152   1G 83 Linux
/dev/sdb7       14688256 16785407  2097152   1G 83 Linux
/dev/sdb8       16787456 33554431 16766976   8G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[root@localhost ~]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048  2099199  2097152   1G 83 Linux
/dev/sdb2        2099200  4196351  2097152   1G 83 Linux
/dev/sdb3        4196352  8390655  4194304   2G 83 Linux
/dev/sdb4        8390656 33554431 25163776  12G  5 Extended
/dev/sdb5        8392704 12587007  4194304   2G  7 HPFS/NTFS/exFAT
/dev/sdb6       12589056 14686207  2097152   1G 83 Linux
/dev/sdb7       14688256 16785407  2097152   1G 83 Linux
/dev/sdb8       16787456 33554431 16766976   8G 83 Linux

Command (m for help): q

[root@localhost ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: f941ea20-4345-4367-8cc5-9d1a4ceb44d0
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

[root@localhost ~]# mkfs.ext4 /dev/sdb2
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: d3232ba5-71fd-4954-8814-59c3d66670f4
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

[root@localhost ~]# mkfs.ext4 /dev/sdb3
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 2720c0a3-a2a9-4123-a4eb-31a0f1666d36
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912

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

[root@localhost ~]# mkfs
mkfs         mkfs.ext2    mkfs.ext4    mkfs.minix   mkfs.vfat    
mkfs.cramfs  mkfs.ext3    mkfs.fat     mkfs.msdos   mkfs.xfs     

[root@localhost ~]# mkfs.vfat /dev/sdb5
mkfs.fat 4.1 (2017-01-24)

[root@localhost ~]# mkfs /dev/sdb6
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: 7063866c-8212-4fc8-a648-ec5e6f40975e
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

[root@localhost ~]# mkfs /dev/sdb7
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: ec6c0b09-6222-4896-bfaf-f709349cbedd
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

[root@localhost ~]# mkfs /dev/sdb8
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 2095872 4k blocks and 524288 inodes
Filesystem UUID: 7ee37194-02b2-4825-b16a-796c4d752cfd
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done 

[root@localhost ~]# cd

[root@localhost ~]# ls
077      Documents  Music     Public     TestCD.iso  aaa              gzipTarTest.tar.gz  initial-setup-ks.cfg  tarTest.tar
Desktop  Downloads  Pictures  Templates  Videos      anaconda-ks.cfg  hello               iso-test

[root@localhost ~]# mkdir b1

[root@localhost ~]# mkdir b2

[root@localhost ~]# mkdir b3

[root@localhost ~]# mkdir b5

[root@localhost ~]# mkdir b6

[root@localhost ~]# mkdir b7

[root@localhost ~]# mkdir b8

[root@localhost ~]# df
Filesystem          1K-blocks    Used Available Use% Mounted on
devtmpfs               463696       0    463696   0% /dev
tmpfs                  493944       0    493944   0% /dev/shm
tmpfs                  493944    7080    486864   2% /run
tmpfs                  493944       0    493944   0% /sys/fs/cgroup
/dev/mapper/cs-root  14034944 5524344   8510600  40% /
/dev/sda1             1038336  237208    801128  23% /boot
tmpfs                   98788       0     98788   0% /run/user/0

[root@localhost ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   16G  0 disk 
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   15G  0 part 
  ├─cs-root 253:0    0 13.4G  0 lvm  /
  └─cs-swap 253:1    0  1.6G  0 lvm  [SWAP]
sdb           8:16   0   16G  0 disk 
├─sdb1        8:17   0    1G  0 part 
├─sdb2        8:18   0    1G  0 part 
├─sdb3        8:19   0    2G  0 part 
├─sdb4        8:20   0    1K  0 part 
├─sdb5        8:21   0    2G  0 part 
├─sdb6        8:22   0    1G  0 part 
├─sdb7        8:23   0    1G  0 part 
└─sdb8        8:24   0    8G  0 part 
sdc           8:32   0   16G  0 disk 
sr0          11:0    1 1024M  0 rom  

[root@localhost ~]# mount /dev/sdb1 b1

[root@localhost ~]# mount /dev/sdb2 b2

[root@localhost ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   16G  0 disk 
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   15G  0 part 
  ├─cs-root 253:0    0 13.4G  0 lvm  /
  └─cs-swap 253:1    0  1.6G  0 lvm  [SWAP]
sdb           8:16   0   16G  0 disk 
├─sdb1        8:17   0    1G  0 part /root/b1
├─sdb2        8:18   0    1G  0 part /root/b2
├─sdb3        8:19   0    2G  0 part 
├─sdb4        8:20   0    1K  0 part 
├─sdb5        8:21   0    2G  0 part 
├─sdb6        8:22   0    1G  0 part 
├─sdb7        8:23   0    1G  0 part 
└─sdb8        8:24   0    8G  0 part 
sdc           8:32   0   16G  0 disk 
sr0          11:0    1 1024M  0 rom  

[root@localhost ~]# mount /dev/sdb3 b3

[root@localhost ~]# mount -t vfat /dev/sdb5 b5

[root@localhost ~]# mount /dev/sdb6 b6

[root@localhost ~]# mount /dev/sdb7 b7

[root@localhost ~]# mount /dev/sdb8 b8

[root@localhost ~]# df
Filesystem          1K-blocks    Used Available Use% Mounted on
devtmpfs               463696       0    463696   0% /dev
tmpfs                  493944       0    493944   0% /dev/shm
tmpfs                  493944    7080    486864   2% /run
tmpfs                  493944       0    493944   0% /sys/fs/cgroup
/dev/mapper/cs-root  14034944 5524364   8510580  40% /
/dev/sda1             1038336  237208    801128  23% /boot
tmpfs                   98788       0     98788   0% /run/user/0
/dev/sdb1              996780      24    927944   1% /root/b1
/dev/sdb2              996780      24    927944   1% /root/b2
/dev/sdb3             1992552      24   1871288   1% /root/b3
/dev/sdb5             2093048       4   2093044   1% /root/b5
/dev/sdb6             1030828      24    978376   1% /root/b6
/dev/sdb7             1030828      24    978376   1% /root/b7
/dev/sdb8             8233436      24   7814240   1% /root/b8

[root@localhost ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   16G  0 disk 
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   15G  0 part 
  ├─cs-root 253:0    0 13.4G  0 lvm  /
  └─cs-swap 253:1    0  1.6G  0 lvm  [SWAP]
sdb           8:16   0   16G  0 disk 
├─sdb1        8:17   0    1G  0 part /root/b1
├─sdb2        8:18   0    1G  0 part /root/b2
├─sdb3        8:19   0    2G  0 part /root/b3
├─sdb4        8:20   0    1K  0 part 
├─sdb5        8:21   0    2G  0 part /root/b5
├─sdb6        8:22   0    1G  0 part /root/b6
├─sdb7        8:23   0    1G  0 part /root/b7
└─sdb8        8:24   0    8G  0 part /root/b8
sdc           8:32   0   16G  0 disk 
sr0          11:0    1 1024M  0 rom  

[root@localhost ~]# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: dos
Disk identifier: 0xd3d3b6e7

Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048  2099199  2097152   1G 83 Linux
/dev/sdb2        2099200  4196351  2097152   1G 83 Linux
/dev/sdb3        4196352  8390655  4194304   2G 83 Linux
/dev/sdb4        8390656 33554431 25163776  12G  5 Extended
/dev/sdb5        8392704 12587007  4194304   2G  7 HPFS/NTFS/exFAT
/dev/sdb6       12589056 14686207  2097152   1G 83 Linux
/dev/sdb7       14688256 16785407  2097152   1G 83 Linux
/dev/sdb8       16787456 33554431 16766976   8G 83 Linux

Command (m for help): q

0개의 댓글