반응형
백업을 위하여 USB에 linux OS 시스템을 복사하였다. 복사하는 방법은 아래의 링크를 이용하여 수행할 수 있다.
https://namsaenga.tistory.com/47
dd command를 이용하여 Linux OS 시스템을 USB로 복사하기
dd command를 이용하여 리눅스(Red Hat Enterprise Linux 8) 시스템 전체를 부팅 가능 USB로 복사한다. dd는 data duplication에서 유래했지만, 매우 강력하기 때문에 디스크 파괴자 또는 데이터 파괴자라고 불리.
namsaenga.tistory.com
linux OS 시스템 USB를 마운트 하여 파일을 이용하는 절차
1. 일반 mount 명령어로 lvm을 마운트 하면 오류가 발생한다.
[root@localhost ~]# mount /dev/sdb3 /mnt/usb
mount: /mnt/usb: unknown filesystem type 'LVM2_member'.
2. lvm2를 설치한다.
[root@localhost ~]# yum install lvm2
3. 디바이스 인식을 위한 모듈을 로드한다.
[root@localhost ~]# modprobe dm-mod
4. lvm 볼륨 그룹 스캔
[root@localhost ~]# vgscan
WARNING: VG name rhel is used by VGs EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g and L3JoDa-tXqP-ZM9i-38tQ-T6KX-Ucsc-M4wyvU.
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
Found volume group "rhel" using metadata type lvm2
Found volume group "rhel" using metadata type lvm2
5. 원하는 디바이스의 UUID 확인
[root@localhost ~]# vgs -o +vg_uuid --config 'devices { filter = [ "a|/dev/sdb|", "r|.*|" ]}'
VG #PV #LV #SN Attr VSize VFree VG UUID
rhel 1 3 0 wz--n- 57.41g 0 EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g
[root@localhost ~]# vgs -o +vg_uuid --config 'devices { filter = [ "a|/dev/sda|", "r|.*|" ]}'
VG #PV #LV #SN Attr VSize VFree VG UUID
rhel 1 3 0 wz--n- 57.41g 0 L3JoDa-tXqP-ZM9i-38tQ-T6KX-Ucsc-M4wyvU
6. UUID를 이용하여 lvm 볼륨을 활성화 상태로 변경
[root@localhost ~]# vgchange -ay --select vg_uuid=EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g
WARNING: VG name rhel is used by VGs EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g and L3JoDa-tXqP-ZM9i-38tQ-T6KX-Ucsc-M4wyvU.
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
WARNING: activating multiple VGs with the same name is dangerous and may fail.
device-mapper: create ioctl on rhel-swap LVM-EcszOlUcTaDbFRpc6MHPzeUdqI3Cdd2gsBGJzwu0zJ2zfWVfp1UqGfNzTxBFvToZ failed: 장치나 자원이 동작 중
device-mapper: create ioctl on rhel-home LVM-EcszOlUcTaDbFRpc6MHPzeUdqI3Cdd2g2HjoGC3PxKIPk8R5mGY1xB8f2gmwBC0f failed: 장치나 자원이 동작 중
device-mapper: create ioctl on rhel-root LVM-EcszOlUcTaDbFRpc6MHPzeUdqI3Cdd2ghLNWmJJIhR3NSNo93yXkdjXdkOqKHkJl failed: 장치나 자원이 동작 중
0 logical volume(s) in volume group "rhel" now active
WARNING: activating multiple VGs with the same name is dangerous and may fail.
7. UUID를 이용하여 USB(/dev/sdb)를 rhel2로 변경
[root@localhost ~]# vgrename EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g rhel2
WARNING: VG name rhel is used by VGs EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g and L3JoDa-tXqP-ZM9i-38tQ-T6KX-Ucsc-M4wyvU.
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
Processing VG rhel because of matching UUID EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g
Volume group "EcszOl-UcTa-DbFR-pc6M-HPze-UdqI-3Cdd2g" successfully renamed to "rhel2"
8. rhel2 활성화
[root@localhost ~]# vgchange -ay rhel2
3 logical volume(s) in volume group "rhel2" now active
9. /dev/mapper에서 rhel2가 잘 활성화 되었는지 확인
[root@localhost ~]# fdisk -l
Disk /dev/sdb: 114.6 GiB, 123048296448 bytes, 240328704 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: gpt
Disk identifier: 135E2228-14FC-436A-A2DF-BAEB437F84B5
Device Start End Sectors Size Type
/dev/sdb1 2048 1230847 1228800 600M EFI System
/dev/sdb2 1230848 3327999 2097152 1G Linux filesystem
/dev/sdb3 3328000 123729919 120401920 57.4G Linux LVM
Disk /dev/mapper/rhel2-swap: 5.9 GiB, 6337593344 bytes, 12378112 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 /dev/mapper/rhel2-home: 16.9 GiB, 18144559104 bytes, 35438592 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 /dev/mapper/rhel2-root: 34.6 GiB, 37161533440 bytes, 72581120 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
9. 마운트하기
[root@localhost ~]# mount /dev/rhel2/home /mnt/usb
10. 마운트 확인
[root@localhost ~]# ls /mnt/usb
namsaenga
[root@localhost namsaenga]# ls
hi hiroo 공개 다운로드 문서 바탕화면 비디오 사진 서식 음악
반응형
'프로그래밍 > OS' 카테고리의 다른 글
리눅스 시리얼 포트 통신 hex data 주고 받기 (0) | 2022.06.18 |
---|---|
리눅스 상에서 시리얼 포트 추가로 인식하게 하는 방법 (0) | 2022.05.31 |
Linux 시리얼 통신 자동 체크 예제 프로그램 소스 코드 (0) | 2022.05.25 |
RHEL 디스플레이 해상도 800x600 보다 높은 값으로 설정 (0) | 2022.05.20 |
grubby를 이용하여 커널 부팅 순서 변경하기 (0) | 2022.05.16 |
댓글