How to migrate existing ext4 partitions to another drive with encrypted partitions












1














So i have an SSD with the following partitions:



1. fat32 - /boot/efi - 190MB boot,esp
2. ext4 / 65.19 GB
3. linux-swap 1.40Gb
4. ext4 /home 398.98 Gb


I bought a new SSD and would like to clone everything from the old one, but make partitions all ext4 encrypted.



What's the best way to go about that? I've read different manuals, specifically this one https://linuxconfig.org/basic-guide-to-encrypting-linux-partitions-with-luks#h2-1-debian-ubuntu, but it is unclear what will will happen after I clone data to the encrypted partition.



Will the system boot and ask me for the password upon booting, as it does when I choose encrypted partitions on a regular Ubuntu install?










share|improve this question




















  • 2




    You cannot really clone. I normally suggest a clean install anytime you have a new drive. And then copy /home and data. Only if you have installed server apps may you have some folders in / that you would also copy. You should do clean install and restore from your normal backups. That then is a test that your backups are complete. And you still have old drive to find anything missing from backup.
    – oldfred
    Dec 18 '18 at 19:43










  • Why can't I clone?
    – snitko
    Dec 18 '18 at 20:16










  • You might succeed, but there are several obstacles, so I agree with @oldfred's advice, to make a fresh installation. See the following link about things that can make cloning go wrong, Cloning from one drive to another drive. If you want to try cloning anyway, I would recommend Clonezilla, which is both faster and safer compared to dd.
    – sudodus
    Dec 18 '18 at 21:00












  • An encrypted install uses LVM or volumes, not partitions, so totally different system configuration. Full-system encryption with manual control and dual-booting Paddy Landau ubuntuforums.org/showthread.php?t=2357627 also if UEFI/gpt you can only easily clone an entire drive. gpt has GUIDs in primary partition table, back up partition table & partition. They must be in sync & many clone tools will not do that if just trying to clone a partition.
    – oldfred
    Dec 18 '18 at 21:48










  • @oldfred Another agreement and you should post that as an answer and I'll come back and upvote after you ping me. 0:-)
    – Fabby
    Dec 19 '18 at 0:12


















1














So i have an SSD with the following partitions:



1. fat32 - /boot/efi - 190MB boot,esp
2. ext4 / 65.19 GB
3. linux-swap 1.40Gb
4. ext4 /home 398.98 Gb


I bought a new SSD and would like to clone everything from the old one, but make partitions all ext4 encrypted.



What's the best way to go about that? I've read different manuals, specifically this one https://linuxconfig.org/basic-guide-to-encrypting-linux-partitions-with-luks#h2-1-debian-ubuntu, but it is unclear what will will happen after I clone data to the encrypted partition.



Will the system boot and ask me for the password upon booting, as it does when I choose encrypted partitions on a regular Ubuntu install?










share|improve this question




















  • 2




    You cannot really clone. I normally suggest a clean install anytime you have a new drive. And then copy /home and data. Only if you have installed server apps may you have some folders in / that you would also copy. You should do clean install and restore from your normal backups. That then is a test that your backups are complete. And you still have old drive to find anything missing from backup.
    – oldfred
    Dec 18 '18 at 19:43










  • Why can't I clone?
    – snitko
    Dec 18 '18 at 20:16










  • You might succeed, but there are several obstacles, so I agree with @oldfred's advice, to make a fresh installation. See the following link about things that can make cloning go wrong, Cloning from one drive to another drive. If you want to try cloning anyway, I would recommend Clonezilla, which is both faster and safer compared to dd.
    – sudodus
    Dec 18 '18 at 21:00












  • An encrypted install uses LVM or volumes, not partitions, so totally different system configuration. Full-system encryption with manual control and dual-booting Paddy Landau ubuntuforums.org/showthread.php?t=2357627 also if UEFI/gpt you can only easily clone an entire drive. gpt has GUIDs in primary partition table, back up partition table & partition. They must be in sync & many clone tools will not do that if just trying to clone a partition.
    – oldfred
    Dec 18 '18 at 21:48










  • @oldfred Another agreement and you should post that as an answer and I'll come back and upvote after you ping me. 0:-)
    – Fabby
    Dec 19 '18 at 0:12
















1












1








1







So i have an SSD with the following partitions:



1. fat32 - /boot/efi - 190MB boot,esp
2. ext4 / 65.19 GB
3. linux-swap 1.40Gb
4. ext4 /home 398.98 Gb


I bought a new SSD and would like to clone everything from the old one, but make partitions all ext4 encrypted.



What's the best way to go about that? I've read different manuals, specifically this one https://linuxconfig.org/basic-guide-to-encrypting-linux-partitions-with-luks#h2-1-debian-ubuntu, but it is unclear what will will happen after I clone data to the encrypted partition.



Will the system boot and ask me for the password upon booting, as it does when I choose encrypted partitions on a regular Ubuntu install?










share|improve this question















So i have an SSD with the following partitions:



1. fat32 - /boot/efi - 190MB boot,esp
2. ext4 / 65.19 GB
3. linux-swap 1.40Gb
4. ext4 /home 398.98 Gb


I bought a new SSD and would like to clone everything from the old one, but make partitions all ext4 encrypted.



What's the best way to go about that? I've read different manuals, specifically this one https://linuxconfig.org/basic-guide-to-encrypting-linux-partitions-with-luks#h2-1-debian-ubuntu, but it is unclear what will will happen after I clone data to the encrypted partition.



Will the system boot and ask me for the password upon booting, as it does when I choose encrypted partitions on a regular Ubuntu install?







boot partitioning encryption 18.10






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 18 '18 at 19:00







snitko

















asked Dec 18 '18 at 18:54









snitkosnitko

195113




195113








  • 2




    You cannot really clone. I normally suggest a clean install anytime you have a new drive. And then copy /home and data. Only if you have installed server apps may you have some folders in / that you would also copy. You should do clean install and restore from your normal backups. That then is a test that your backups are complete. And you still have old drive to find anything missing from backup.
    – oldfred
    Dec 18 '18 at 19:43










  • Why can't I clone?
    – snitko
    Dec 18 '18 at 20:16










  • You might succeed, but there are several obstacles, so I agree with @oldfred's advice, to make a fresh installation. See the following link about things that can make cloning go wrong, Cloning from one drive to another drive. If you want to try cloning anyway, I would recommend Clonezilla, which is both faster and safer compared to dd.
    – sudodus
    Dec 18 '18 at 21:00












  • An encrypted install uses LVM or volumes, not partitions, so totally different system configuration. Full-system encryption with manual control and dual-booting Paddy Landau ubuntuforums.org/showthread.php?t=2357627 also if UEFI/gpt you can only easily clone an entire drive. gpt has GUIDs in primary partition table, back up partition table & partition. They must be in sync & many clone tools will not do that if just trying to clone a partition.
    – oldfred
    Dec 18 '18 at 21:48










  • @oldfred Another agreement and you should post that as an answer and I'll come back and upvote after you ping me. 0:-)
    – Fabby
    Dec 19 '18 at 0:12
















  • 2




    You cannot really clone. I normally suggest a clean install anytime you have a new drive. And then copy /home and data. Only if you have installed server apps may you have some folders in / that you would also copy. You should do clean install and restore from your normal backups. That then is a test that your backups are complete. And you still have old drive to find anything missing from backup.
    – oldfred
    Dec 18 '18 at 19:43










  • Why can't I clone?
    – snitko
    Dec 18 '18 at 20:16










  • You might succeed, but there are several obstacles, so I agree with @oldfred's advice, to make a fresh installation. See the following link about things that can make cloning go wrong, Cloning from one drive to another drive. If you want to try cloning anyway, I would recommend Clonezilla, which is both faster and safer compared to dd.
    – sudodus
    Dec 18 '18 at 21:00












  • An encrypted install uses LVM or volumes, not partitions, so totally different system configuration. Full-system encryption with manual control and dual-booting Paddy Landau ubuntuforums.org/showthread.php?t=2357627 also if UEFI/gpt you can only easily clone an entire drive. gpt has GUIDs in primary partition table, back up partition table & partition. They must be in sync & many clone tools will not do that if just trying to clone a partition.
    – oldfred
    Dec 18 '18 at 21:48










  • @oldfred Another agreement and you should post that as an answer and I'll come back and upvote after you ping me. 0:-)
    – Fabby
    Dec 19 '18 at 0:12










2




2




You cannot really clone. I normally suggest a clean install anytime you have a new drive. And then copy /home and data. Only if you have installed server apps may you have some folders in / that you would also copy. You should do clean install and restore from your normal backups. That then is a test that your backups are complete. And you still have old drive to find anything missing from backup.
– oldfred
Dec 18 '18 at 19:43




You cannot really clone. I normally suggest a clean install anytime you have a new drive. And then copy /home and data. Only if you have installed server apps may you have some folders in / that you would also copy. You should do clean install and restore from your normal backups. That then is a test that your backups are complete. And you still have old drive to find anything missing from backup.
– oldfred
Dec 18 '18 at 19:43












Why can't I clone?
– snitko
Dec 18 '18 at 20:16




Why can't I clone?
– snitko
Dec 18 '18 at 20:16












You might succeed, but there are several obstacles, so I agree with @oldfred's advice, to make a fresh installation. See the following link about things that can make cloning go wrong, Cloning from one drive to another drive. If you want to try cloning anyway, I would recommend Clonezilla, which is both faster and safer compared to dd.
– sudodus
Dec 18 '18 at 21:00






You might succeed, but there are several obstacles, so I agree with @oldfred's advice, to make a fresh installation. See the following link about things that can make cloning go wrong, Cloning from one drive to another drive. If you want to try cloning anyway, I would recommend Clonezilla, which is both faster and safer compared to dd.
– sudodus
Dec 18 '18 at 21:00














An encrypted install uses LVM or volumes, not partitions, so totally different system configuration. Full-system encryption with manual control and dual-booting Paddy Landau ubuntuforums.org/showthread.php?t=2357627 also if UEFI/gpt you can only easily clone an entire drive. gpt has GUIDs in primary partition table, back up partition table & partition. They must be in sync & many clone tools will not do that if just trying to clone a partition.
– oldfred
Dec 18 '18 at 21:48




An encrypted install uses LVM or volumes, not partitions, so totally different system configuration. Full-system encryption with manual control and dual-booting Paddy Landau ubuntuforums.org/showthread.php?t=2357627 also if UEFI/gpt you can only easily clone an entire drive. gpt has GUIDs in primary partition table, back up partition table & partition. They must be in sync & many clone tools will not do that if just trying to clone a partition.
– oldfred
Dec 18 '18 at 21:48












@oldfred Another agreement and you should post that as an answer and I'll come back and upvote after you ping me. 0:-)
– Fabby
Dec 19 '18 at 0:12






@oldfred Another agreement and you should post that as an answer and I'll come back and upvote after you ping me. 0:-)
– Fabby
Dec 19 '18 at 0:12












0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1102904%2fhow-to-migrate-existing-ext4-partitions-to-another-drive-with-encrypted-partitio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1102904%2fhow-to-migrate-existing-ext4-partitions-to-another-drive-with-encrypted-partitio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Quarter-circle Tiles

build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

Mont Emei