<html style="direction: ltr;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body bidimailui-charset-is-forced="true" style="direction: ltr;"
text="#000000" bgcolor="#FFFFFF">
<p>Here's how I do such stuff:</p>
<ol>
<li>Partition the new disk however you want.</li>
<li>Boot from a live disk (e.g. - an Ubuntu installation DoK)</li>
<li>Mount both old and new, and copy everything over. I usually
use "cd old ; tar cf - . | tar -C /new xvf -".</li>
<li>Shut down machine, remove old disk, boot up with Ubuntu Dok
again</li>
<li>Mount the new drive somewhere, and do the following commands:</li>
<ol>
<li>mount --bind /dev /new/dev</li>
<li>chroot /new</li>
<li>mount none /sys -t sysfs</li>
<li>mount proc /proc -t proc</li>
<li>Update /etc/fstab and /etc/crypttab in case they have ID
based mounts, as the partition IDs have now changed<br>
</li>
<li>install-grub /dev/sda (or nvme0n1, whatever)</li>
<li>(probably not necessary, but just to be on the safe side):
mkinitrd (need to look up precise command line)<br>
</li>
</ol>
</ol>
<p>Unmount everything and reboot, and you should be golden.</p>
<p><br>
</p>
<p>Shachar<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 01/05/2019 7:29, Shlomo Solomon
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20190501072937.7bc0db3b@shlomo1.solomon">
<pre class="moz-quote-pre" wrap="">The subject says it all. But a few more details. My 1Tb drive is
about to die and I'm moving to a new 3Tb drive. The drive
(/dev/sda) includes 5 partitions - / , /home , /boot/efi , /data ,
swap. Most of the bad blocks seem to be in the /data partition.
Needless to say, I have good backups of everything on an external
drive.
There are many ways to do this and I'm not looking for instructions,
but "opinions" about what would be most efficient. I've considered a
few options - but each seem to have advantages and dis-advantages:
1 - A fresh install and then update configurations and copy whatever
else I need from the old drive or from my backup drive. (Advantage - get
rid of old junk, Dis-advantage - seems like a lot of work)
2 - dd - and then, of course enlarge the partitions and/or add new
partitions to use the added 2Tb. (Advantage - safe, Dis-advantage -
there are many bad blocks on the old drive so ...)
3 - ddrescue (Advantage - may be better at handling the bad
blocks, Dis-advantage - how safe is this?)
4 - Clonezilla (I never used this so I don't know)
I'm assuming that after solutions #2, #3 and #4 I would only need
to switch the sda cable so the new drive would become /dev/sda and
of course edit fstab to correct all the UUID= lines.
I'd like to hear opinions about which of these solutions (or any other
solution) is best.
</pre>
</blockquote>
</body>
</html>