Skip site navigation (1)Skip section navigation (2)
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
--0000000000001a4bc305fc0cb833
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, May 19, 2023 at 4:21=E2=80=AFPM 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 bee=
n
> 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=3D/dev/old-drive of=3D/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?

--=20
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' =C2=AF\_(=E3=83=84)_/=C2=AF :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]

--0000000000001a4bc305fc0cb833
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, May 19, 2023 at 4:21=E2=80=AF=
PM Tim Daneliuk &lt;<a href=3D"mailto:tundra@tundraware.com" target=3D"_bla=
nk">tundra@tundraware.com</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">On 5/19/23 07:12, Robert Huff wrote:<br>
&gt; Odhiambo Washington asks:<br>
&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 I have a 1TB disk, with UFS fs.<br>
&gt;&gt;=C2=A0 =C2=A0 I&#39;d like to migrate to a 2TB SSD and retire/repur=
pose the 1TB disk.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0[deletia]<br>
&gt; <br>
&gt;&gt;=C2=A0 =C2=A0 What is the easiest/best method to migrate?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0What I would do:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A01) Put the new disk in an external drive doc=
k.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A02) Format/label the new disk.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A03) Use dump/restore to transfer the contents=
; check for<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0integrity.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A04) Unmount the new disk; shutdown computer; =
swap disks; boot.<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0Anyone got a better plan?<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0Respectfully,<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Robert Huff<br>
<br>
<br>
I dunno about &quot;better&quot; but I use a somewhat different strategy.=
=C2=A0 It&#39;s been<br>
a while but it&#39;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=3D/dev/old-drive of=3D/dev/new-drive<br>
- Shut down and remove old drive<br>
- Reboot from recovery media like a linux repair disk that has &#39;gparted=
&#39; on it.<br>
- Use gparted to edit and resize (grow only) the relevant partition(s)<br>
- Reboot and use &#39;growfs&#39; to make the full disk size available to t=
he filesystem(s)<br></blockquote><div><br></div><div>This sounds good and h=
as given me an idea.=C2=A0</div><div>1. Get=C2=A0memstick.img and write tha=
t 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. B=
oot off the memstick and go to single-user mode. Mount the original disk an=
d the new disk<br>=C2=A0 =C2=A0 mkdir /mnt1 /mnt2</div><div>=C2=A0 =C2=A0 m=
ount /dev/ada1p2 /mnt1=C2=A0 =C2=A0# Ensure this is the 1TB disk</div><div>=
=C2=A0 =C2=A0 mount /dev/ada2p2 /mnt2=C2=A0 =C2=A0# Ensure this is the 2Tb =
disk</div><div>5. Do a dump:</div><div>=C2=A0 =C2=A0=C2=A0/sbin/dump -u -0a=
f - /mnt1 | (cd /mnt2; restore -rf -)</div><div><br></div><div>If `clone` w=
as 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 wi=
th this approach?<br clear=3D"all"><div><br></div><span>-- </span><br><div =
dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div>Best regards,<br>Odhiamb=
o WASHINGTON,<br>Nairobi,KE<br>+254 7 3200 0004/+254 7 2274 3223<br>&quot;<=
span style=3D"font-size:12.8px">Oh, the cruft.</span><span style=3D"font-si=
ze:12.8px">&quot;,=C2=A0</span><span style=3D"font-size:12.8px">egrep -v &#=
39;^$|^.*#&#39;=C2=A0</span><span style=3D"background-color:rgb(34,34,34);c=
olor:rgb(238,238,238);font-family:&quot;Lucida Console&quot;,Consolas,&quot=
;Courier New&quot;,monospace;font-size:13.6px">=C2=AF\_(=E3=83=84)_/=C2=AF<=
/span><span style=3D"font-size:12.8px">=C2=A0:-)</span></div><div><span sty=
le=3D"font-size:12.8px">[How to ask smart questions:=C2=A0</span><span styl=
e=3D"font-size:12.8px"><a href=3D"http://www.catb.org/~esr/faqs/smart-quest=
ions.html" target=3D"_blank">http://www.catb.org/~esr/faqs/smart-questions.=
html</a>]</span></div></div></div></div></div>

--0000000000001a4bc305fc0cb833--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAdA2WMn4JVV5oOsNnkqDC8kbNVF5hSFjN79sjqjBKB98Sg0_Q>