565 tutoriels disponibles
Chercher un tutoriel
Bienvenue
sur Shareannonce
 
Clone partition ext4, swap, EFI on ubuntu
Ecrit par: Shareannonce
Date création:  20-12-2018
Nombre de vues:  2140
Catégorie:  informatique > linux
Note: 
 
   Tutoriel N° 2c8


Backup partition ext4, swap, EFI on ubuntu



1/ Boot on external linux (Live CD, or vmware)
2/ Install tools
3/ Backup ext4 partition
4/ Restore your ext4 partition on same disk and same location sdb3
5/ Create a new external usb disk with the backup ext4 partition



1/ Boot on external linux (Live CD, or vmware)

You need Live CD ubuntu, or a wmware linux because we need clone an umount partition.
Boot on Live CD ubuntu (or vmware)

Install pv:
shareannonce@shareannonce:~$ sudo apt install pv

Use root user:
shareannonce@shareannonce:~$ sudo passwd root (if you don't have create your root account)

Find your partition name to clone ext4:
shareannonce@shareannonce:~$ sudo fdisk -l



3/ Backup ext4 partition

shareannonce@shareannonce:~$ sudo su
shareannonce@shareannonce:~$ pv < /dev/sdb3 > sdb3.img



4/ Restore your ext4 partition on same disk and same location sdb3

You need to have boot on external linux (Live CD USB per example)

sudo fdisk -l to check the name of the ext4 partition to restore (/dev/sdb3)

unmount partition:
shareannonce@shareannonce:~$ umount /dev/sdb3

format partition (optional):
shareannonce@shareannonce:~$ mke2fs -t ext4 /dev/sdb3

restore partition:
shareannonce@shareannonce:~$ pv < sdb3.img > /dev/sdb3


5/ Create a new external usb disk with the backup ext4 partition

Clone on another disk
First Time on target disk sdc:
You need to have free space on your disk (format GUID with disk utilities on macos)

/dev/sdc1: You need an EFI partition (if doesn't exist) -200Mo
/dev/sdc2: Create ext4 (same size) with gparted and format - 10Go
/dev/sdc3: Create linux swap (same size) needn't to be format - 8Go

unmount partition:
shareannonce@shareannonce:~$ umount /dev/sdc4

restore partition:
shareannonce@shareannonce:~$ pv < sdb3.img > /dev/sdc4

mount partition:
shareannonce@shareannonce:~$ mount /dev/sdc4 (ignore error)

shareannonce@shareannonce:~$ lsblk --fs show uuid
shareannonce@shareannonce:~$ sudo blkid show uuid



shareannonce@shareannonce:~$ nano /media/user/d4395783-57dc-4d4b-967a-150b2c89b464/etc/fstab

UUID=82e6edf2-b00a-4c93-97a0-8235a6ab09d5

Replace UUID with the new UUID of the linux swap partition

UUID=efdb3d2f-a325-44ae-a508-68f2ec849614

You need to make a gdisk and refind on EFI partition (watch other tutoriel)
https://www.shareannonce.com/david/tutorial/2c5
13/ 14/ /15 /16

Boot with alt key (on macos)


 
 
   Autres tutoriels de la même catégorie >
 
ShareAnnonce version 2.0 Tous droits reserves. | Condition d'utilisation | Contact