Date: Fri, 19 May 2023 17:26:44 +0300 From: Odhiambo Washington <odhiambo@gmail.com> To: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: Moving to a larger disk Message-ID: <CAAdA2WMn4JVV5oOsNnkqDC8kbNVF5hSFjN79sjqjBKB98Sg0_Q@mail.gmail.com> In-Reply-To: <a3009e36-ae80-1a11-1186-87b1ac00cc1e@tundraware.com> References: <CAAdA2WOK3HVmJzWkt-1Un=8ytmLcey5Byvs=brtWhVGvw3iPvQ@mail.gmail.com> <25703.26549.49813.771008@jerusalem.litteratus.org> <a3009e36-ae80-1a11-1186-87b1ac00cc1e@tundraware.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Fri, May 19, 2023 at 4:21 PM Tim Daneliuk <tundra@tundraware.com> wrote:
> On 5/19/23 07:12, Robert Huff wrote:
> > Odhiambo Washington asks:
> >
> >> I have a 1TB disk, with UFS fs.
> >> I'd like to migrate to a 2TB SSD and retire/repurpose the 1TB disk.
> >
> > [deletia]
> >
> >> What is the easiest/best method to migrate?
> >
> > What I would do:
> > 1) Put the new disk in an external drive dock.
> > 2) Format/label the new disk.
> > 3) Use dump/restore to transfer the contents; check for
> > integrity.
> > 4) Unmount the new disk; shutdown computer; swap disks; boot.
> >
> >
> > Anyone got a better plan?
> >
> >
> > Respectfully,
> >
> >
> > Robert Huff
>
>
> I dunno about "better" but I use a somewhat different strategy. It's been
> a while but it's very roughly this:
>
> - Install the new drive by some means
> - Quiesce all highly active processes like web and db servers
> - dd if=/dev/old-drive of=/dev/new-drive
> - Shut down and remove old drive
> - Reboot from recovery media like a linux repair disk that has 'gparted'
> on it.
> - Use gparted to edit and resize (grow only) the relevant partition(s)
> - Reboot and use 'growfs' to make the full disk size available to the
> filesystem(s)
>
This sounds good and has given me an idea.
1. Get memstick.img and write that to a USB drive.
2. Install FreeBSD to the new disk.
3. Power down, and connect the new disk as a secondary drive.
4. Boot off the memstick and go to single-user mode. Mount the original
disk and the new disk
mkdir /mnt1 /mnt2
mount /dev/ada1p2 /mnt1 # Ensure this is the 1TB disk
mount /dev/ada2p2 /mnt2 # Ensure this is the 2Tb disk
5. Do a dump:
/sbin/dump -u -0af - /mnt1 | (cd /mnt2; restore -rf -)
If `clone` was available in the base, I would then do:
clone -d -y /mnt1 /mnt2
Does anyone see a problem with this approach?
--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]
[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 19, 2023 at 4:21 PM Tim Daneliuk <<a href="mailto:tundra@tundraware.com" target="_blank">tundra@tundraware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/19/23 07:12, Robert Huff wrote:<br>
> Odhiambo Washington asks:<br>
> <br>
>> I have a 1TB disk, with UFS fs.<br>
>> I'd like to migrate to a 2TB SSD and retire/repurpose the 1TB disk.<br>
> <br>
> [deletia]<br>
> <br>
>> What is the easiest/best method to migrate?<br>
> <br>
> What I would do:<br>
> 1) Put the new disk in an external drive dock.<br>
> 2) Format/label the new disk.<br>
> 3) Use dump/restore to transfer the contents; check for<br>
> integrity.<br>
> 4) Unmount the new disk; shutdown computer; swap disks; boot.<br>
> <br>
> <br>
> Anyone got a better plan?<br>
> <br>
> <br>
> Respectfully,<br>
> <br>
> <br>
> Robert Huff<br>
<br>
<br>
I dunno about "better" but I use a somewhat different strategy. It's been<br>
a while but it's very roughly this:<br>
<br>
- Install the new drive by some means<br>
- Quiesce all highly active processes like web and db servers<br>
- dd if=/dev/old-drive of=/dev/new-drive<br>
- Shut down and remove old drive<br>
- Reboot from recovery media like a linux repair disk that has 'gparted' on it.<br>
- Use gparted to edit and resize (grow only) the relevant partition(s)<br>
- Reboot and use 'growfs' to make the full disk size available to the filesystem(s)<br></blockquote><div><br></div><div>This sounds good and has given me an idea. </div><div>1. Get memstick.img and write that to a USB drive.</div><div>2. Install FreeBSD to the new disk.</div><div>3. Power down, and connect the new disk as a secondary drive.</div><div>4. Boot off the memstick and go to single-user mode. Mount the original disk and the new disk<br> mkdir /mnt1 /mnt2</div><div> mount /dev/ada1p2 /mnt1 # Ensure this is the 1TB disk</div><div> mount /dev/ada2p2 /mnt2 # Ensure this is the 2Tb disk</div><div>5. Do a dump:</div><div> /sbin/dump -u -0af - /mnt1 | (cd /mnt2; restore -rf -)</div><div><br></div><div>If `clone` was available in the base, I would then do:</div><div><br></div><div>clone -d -y /mnt1 /mnt2<br></div><div><br></div></div>Does anyone see a problem with this approach?<br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Best regards,<br>Odhiambo WASHINGTON,<br>Nairobi,KE<br>+254 7 3200 0004/+254 7 2274 3223<br>"<span style="font-size:12.8px">Oh, the cruft.</span><span style="font-size:12.8px">", </span><span style="font-size:12.8px">egrep -v '^$|^.*#' </span><span style="background-color:rgb(34,34,34);color:rgb(238,238,238);font-family:"Lucida Console",Consolas,"Courier New",monospace;font-size:13.6px">¯\_(ツ)_/¯</span><span style="font-size:12.8px"> :-)</span></div><div><span style="font-size:12.8px">[How to ask smart questions: </span><span style="font-size:12.8px"><a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a>]</span></div></div></div></div></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAdA2WMn4JVV5oOsNnkqDC8kbNVF5hSFjN79sjqjBKB98Sg0_Q>
