|
http://cafe.daum.net/candan/HiU9/62
swap 외부로 빼주기
su
cd /mnt/다른하드
다른 하드로 갑니다(본문에서는 /에 생성 하는대 이렇게 하면 백업 할때 구찮음)
dd if=/dev/zero of=/mnt/다른하드/swapfile bs=1024 count=524288
이것을 하지 않으면 swp가 오래 되었다고 어쩌구 나오네요 old
fallocate -l 8.1G /mnt/다른하드/swapfile
전 8.1G로 생성 하였습니다 요즘 보통 램이 기본이 8G니깐요.. 본인의 램이 16G시면 16G로 하시면 되네요
chmod 0600 /mnt/다른하드/swapfile
보안을 위해서 권한 상승.
ll /mnt/다른하드/swapfile -h
잘 만들어 졌는지 확인
mkswap /mnt/다른하드/swapfile
스왓 파일로 적용 old 문구가 나오면 위에 dd if 저것을 해주세요.
swapon /mnt/다른하드/swapfile
임시 등록 해줍니다
swapon -a
blkid
현재 어떻게 등록 되어 있는지 확인 swap 라고 찾으시면 되네요.
그리고 번호를 적으세요. 다른 곳에
(UUID로 하면 에러가 발생 gg)
cp /etc/fstab /etc/fstab.bak
고치기 전에 미례 백업 하기.
nano /etc/fstab
노트 펴고 아래 경로를 입력 하면 되네요 이때 파일의 경우 UUID가 에러가 나네요 -_-;; 결론적으로 경로만 되나 봅니다.
그리고 기존 swap 부분에 앞 부분에는 # 주석 쳐리 해주세요 오류가 날수 있으니 말이죠.
/mnt/다른하드/swapfile none swap sw 0 0
(클릭 하면 확대 보여짐)
swap 등록 되어 있는 곳에서 변경 합니다.
결론은 새로 등록 할때는 경로만 변경 해주면 되는 거죠
nano /etc/fstab
/mnt/다른하드/swapfile none swap sw 0 0
https://errietta.me/blog/luks-clonezilla/
https://en.wikipedia.org/wiki/Partclone
https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption
http://cafe.daum.net/candan/HfuW/49
clonezilla test ver.
Map the device as you normally would (supposing your LUKS partition is /dev/sda5):
clonezilla 터미널로 들어 가서.
sudo -i
#
cryptsetup luksOpen /dev/sda5 crypt
You should now load some kernel modules:
modprobe dm-mod vgchange -ay
lvscan
(마우스 우클릭 해서 적습니다)저의 경우 /dev/ubuntu-gnome-vg/root
나왔습니다.
mount /dev/sdX /mnt
일단 저장할 곳을 마운트 해줍니다.
You should now have /dev/mapper/yourdevice-vg–root or similar.
You can use the partclone
tool now.
To back up:
partclone.ext4 -c -s /dev/mapper/yourdevice-vg--root -o /mnt/path-to-backup-disk/backup/image.img
partclone.ext4 -c -s /dev/ubuntu-gnome-vg/root -o /mnt/test.img
(고친 부분) 참고로 fsck 해주어야 하겠죠?.. 그전에.
This will clone the decrypted ext4 filesystem and save it to /mnt/path-to-backup-disk.
To restore:
partclone.ext4 -r -s /mnt/path-to-backup-disk/backup/image.img -o /dev/mapper/yourdevice-vg--root
Easier than you’d think! Once again, be extra careful with your backups, for without the encryption, your data will be compromised if they fall to the wrong hands.
# 정리
# clonezilla 터미널로 들어 가서.
sudo -i
#
parted -l
# (ext4 find )
mount /dev/sdX /mnt
# (D:\ HDD /dev/sdb or sdc?)
cryptsetup luksOpen /dev/sdX crypt
# me /dev/sda3
modprobe dm-mod
vgchange -ay
lvscan
# (me print= /dev/ubuntu-gnome-vg/root)
# (fsck error prevention :D ) e2fsck.exe4 -p /dev/sdX or fsck.exe4 -p /dev/sdX
fsck.ext4 -a /dev/ubuntu-gnome-vg/root
#backup
vgcfgbackup
위치
cd /ect/lvm/backup/
ubuntu-gnome-vg
cp /ect/lvm/backup/ubuntu-gnome-vg /mnt
cryptsetup luksHeaderBackup /dev/sda3X --header-backup-file You_file_name
partclone.ext4 -c -s /dev/ubuntu-gnome-vg/root -o /mnt/test.img
# or Partition device( -d)
partclone.ext4 -c -d -s /dev/ubuntu-gnome-vg/root -o /mnt/test.img
partclone.fat32 -c -d -s /dev/sda1 -O /mnt/efi.img
partclone.ext2 -c -d -s /dev/sda2 -O /mnt/boot.img
# o와 O의 차이는 O는 덥어 쓰기 c d s 순서가 아니면 오류가 난다.
#restore
vgscan
위치
cd /ect/lvm/backup/
ubuntu-gnome-vg
cp /ect/lvm/backup/ubuntu-gnome-vg /mntvgcfgrestore -f test 경로 (아직 미완성)
cryptsetup luksHeaderRestore <device> --header-backup-file <file>
partclone.ext4 -r -s /mnt/test.img -o /dev/ubuntu-gnome-vg/root
# or Partition device( -d)
partclone.ext4 -r -d -s /mnt/test.img -o /dev/ubuntu-gnome-vg/root
partclone.fat32 -r -d -s /mnt/efi.img -O /dev/sda1
partclone.ext2 -r -d -s /mnt/boot.img -O /dev/sda2
cryptsetup close /dev/ubuntu-gnome-vg/root
umount -l /mnt
sync
exit
exit
참고 사항 아래 것은 하지 마세요 -_- 피봤네요 ㅎㅎ lvm 과 연동 되고 막 복잡 해서 ㅠㅠ.. 결국 실패 했네요 ㅎㅎ 좀더 알아야 할것 같아요.
http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/
cryptsetup -y -v luksFormat /dev/xvdc
YES 대문자 입력 해야 한다.
하드가 완전 새로운 하드의 경우 즉 dd if 로 완전 밀어 버린 경우 해당 될것 같습니다.
/dev/sda3에 해당 되는 파티션이 ext4 / 파티션에 해당 할껀대 이렇게 해주는 것 같습니다. 암호화 된 raw 파티션 자체가 날라간 경우 해당.
수동으로 새로 생성 하기.
포멧할 경우. 즉 강제 종료 했을 경우.. 어쩔수 없이 깨지거나 할 경우
mkfs.ext4 -L "" /dev/ubuntu-gnome-vg/root
이렇게 해서 깨끗하게 하고 다시 복구 해준다.
[mkfs.ext4 로그 아웃 에러시]
http://askubuntu.com/questions/224369/cryptswap-boot-error-cant-mount
https://www.martineve.com/2012/11/02/luks-encrypting-multiple-partitions-on-debianubuntu-with-a-single-passphrase/
http://www.tecmint.com/linux-hard-disk-encryption-using-luks/
(포인트)
강제 mkfs 했더니 오류가 났는지 해서
sudo blkid 해서.
/dev/mapper/ubuntu--gnome--vg-root: UUID=
sudo nano /etc/crypttab
sda3_crypt UUID=에 복사 해서 변경 해주었네요 로그아웃 할때 에러 나더라고요 ㅎㅎ
swap의 경우 아래 것을 것으로 써야 합니다.
/dev/mapper/ubuntu--gnome--vg-swap_1: UUID=
그리고 신기 한건 crypt 에서는 swap 파티션을 마운트 하지 사용 하고 있음을 알수 있다네요 -0- 신기 옛날 부터 테스트 할때 오류 인줄 알았는대 원래 그런거 하여간 천재들 너무 많음 ㅎㅎ;;
cat /proc/swaps
실패 노트 아래 명령어는 미완성 ㅠㅠ 완되네요 이런
http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/
https://help.ubuntu.com/community/UbuntuDesktopLVM
http://askubuntu.com/questions/429612/device-mapper-remove-ioctl-on-luks-xxxx-failed-device-or-resource-busy
dd if=/dev/zero of=/dev/sda3X
cryptsetup luksFormat /dev/xvdc
YES (대문자로 하셔야 되네요.
parted -l (맨 마지막 부분에 나옵니다=홍길동경로)
cryptsetup luksOpen 홍길동경로 crypt
mkfs.ext4 -L "" 홍길동경로
pvcreate 홍길동경로
vgcreate ubuntu--gnome--vg 홍길동경로
lvcreate -L 8G -n swap ubuntu--gnome--vg
lvcreate -l 100%FREE -n root ubuntu--gnome--vg
lvscan
vgchange -a n /dev/
비활성
vgexport /dev/
지울때..
vgscan 검색
http://www.tuxradar.com/answers/212
dmsetup ls 마운트 검색
dmsetup remove 지울수 있음 ㅎㅎ;; (아직 명확하지 않음 지워도 되는지)
cryptsetup close 홍길동경로
reboot
mount /dev/sdX /mnt
# (D:\ HDD /dev/sdb or sdc?)
cryptsetup luksOpen /dev/sdX crypt
# me /dev/sda3
modprobe dm-mod
vgchange -ay
lvscan
# or Partition device( -d)
partclone.ext4 -C -r -d -s /mnt/test.img -o /dev/ubuntu-gnome-vg/root
-_- 결론 니미 안됨
-C는 싸이즈가 틀리다고 해서 그리고 마운트도 안된다 ㅠㅠ 이런 -d를 뺐어야 했나?..
참고로 -d는 드라이브 정보 입니다.
수동 설치 방법
http://linuxbsdos.com/2014/01/16/manual-full-disk-encryption-setup-guide-for-ubuntu-13-10-linux-mint-16/
http://linuxbsdos.com/2014/01/16/manual-full-disk-encryption-setup-guide-for-ubuntu-13-10-linux-mint-16/2/
수동 설치 방법.. 어렵네 -_- (이건 올바른 방법이 아닙니다 정석이라 보기 어렵네요 ㅎㅎ 아직은 구현 안되었나 봐요 수동 설치가)
노하우는 전체 설치에서 boot랑 efi는 450m 500m 정도 잡고.
나머지는 확장으로 잡아 주는 것이 팁이였음. 하나 하나 확장으로 한대 문제는 현재 버그인지 오류남 -0-;; 영상 올렸는대 될지 모르겠음.
제 개인적인 생각으로 좀.. 아직은 너무 중고 낭방.. 하나로 통일 되어야 하는대. lvm도 그렇고 너무 이렇게 저렇게 하다 보니..
첫댓글 https://forum.ubuntuusers.de/topic/mit-luks-verschluesselte-lvm-mounten/
sudo fsck.ext4 -a /dev/sda1
e2fsck.ext4 -p /dev/sdc1
fsck.ext4 -p /dev/sdc1
https://sourceforge.net/p/partclone/bugs/8/
partclone.fat32 -c -s /dev/sda1 -O /mnt/efi.img
partclone.ext2 -c -s /dev/sda2 -O /mnt/boot.img
http://www.partclone.org/usage/partclone.php
http://www.linuxforums.org/forum/newbie/158234-solved-clonezilla-cant-boot-restored-pc.html
dd if=/dev/sda of=mbr1.img bs=446 count=1
dd if=<path_of_mbr1.img file> of=/dev/sda bs=446 count=1
mbr 백업
http://sacstory.tistory.com/entry/%ED%95%98%EB%93%9C-%EC%B6%94%EA%B0%80%EC%8B%9C
cryptsetup luksFormat /dev/mapper/
http://www.tecmint.com/linux-hard-disk-encryption-using-luks/
강제 mkfs 했더니 오류가 났는지 해서
sudo blkid 해서.
/dev/mapper/ubuntu--gnome--vg-root: UUID=
sudo nano /etc/crypttab
sda3_crypt UUID=에 복사 해서 변경 해주었네요 로그아웃 할때 에러 나더라고요 ㅎㅎ
swap 파일로 만들 경우 암호화 파일
http://askubuntu.com/questions/248158/how-do-i-setup-an-encrypted-swap-file
http://www.tecmint.com/disk-encryption-in-linux/
http://ubuntuforums.org/showthread.php?t=2326833
물어 보고 있지만 ㅠㅠ 과연 희망이 있을까? 컴맹의 길은 멀다 ㅠㅠ
http://linuxbsdos.com/2014/01/16/manual-full-disk-encryption-setup-guide-for-ubuntu-13-10-linux-mint-16/
http://linuxbsdos.com/2014/01/16/manual-full-disk-encryption-setup-guide-for-ubuntu-13-10-linux-mint-16/2/
수동 설치 방법.. 어렵네 -_-
http://www.stefan-seelmann.de/wiki/cryptsetup
http://www.n2ws.com/how-to-guides/how-to-create-an-lvm-volume-on-aws.html
http://www.nakivo.com/helpcenter/display/KB/Extending+Backup+Repository+on+Virtual+Appliance
결론적으로 lvm를 쉽게 전체 저장 하는 방법은 그다지 없는 것 같습니다. 기존 뼈대가 있는 상태여야 복원이 가능 하고.
아무래도 개발자가 처음 디자인 할때 백업이란 개념 자체를 넣지 않아서 그런것 아닐까 생각 하네요.
https://wiki.voidlinux.eu/Installer_Partitioning
parted
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=23773
yum install ecryptfs-utils
ecryptfs-setup-swap
https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption
https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system
http://blog.fritzhardy.com/?p=684
swap 만들기 매우 상세 하며 잘되어 있음.. 성공 하진 못했지만.. 생성 까지는 완성