Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 May 2023 18:43:57 +0200
From:      Tomek CEDRO <tomek@cedro.info>
To:        Odhiambo Washington <odhiambo@gmail.com>
Cc:        questions@freebsd.org
Subject:   Re: Moving to a larger disk
Message-ID:  <CAFYkXjkU1eP=ao40wrNf1M92L9M8eL%2BtdRAqjFqHNJYmCpnhkw@mail.gmail.com>
In-Reply-To: <CAAdA2WMtS5KEgKXOOryc=uvoFArtAH08D_sEp0cOk2ovPGvtZQ@mail.gmail.com>
References:  <CAAdA2WOK3HVmJzWkt-1Un=8ytmLcey5Byvs=brtWhVGvw3iPvQ@mail.gmail.com> <aaf85d2f-2639-88fc-e9ba-0d034a1f1398@holgerdanske.com> <CAAdA2WNXFx3MMZvfmFnM_=CwhRb3EbB=KtP2Jf7sYUebV%2Bnp=g@mail.gmail.com> <7ddd1225-11d1-01e4-eed9-aea676cc4256@freebsd.org> <CAAdA2WMtS5KEgKXOOryc=uvoFArtAH08D_sEp0cOk2ovPGvtZQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 20, 2023 at 10:45=E2=80=AFAM Odhiambo Washington wrote:
> I did not hint on moving to ZFS. I just need to move from a 1TB to a 2TB =
disk.
> No intention of changing the FS.

1. Boot off external media cdrom/memstick.
2. Note old disk (i.e. /dev/ada0) and new disk (i.e. /dev/ada1) devices.
3. dd if=3D/dev/olddisk of=3D/dev/newdisk bs=3D100m status=3Dprogress (DO N=
OT
MESS UP OLD DISK AND NEW DISK :-) )
4. Power off the machine. Detach old disk and connect its data wire to
a new disk. New disk is now attached to the same port of the
controller (so it is now i.e. /dev/ada0 as the original one) and
byte-to-byte copy of the old one.
5. Boot the machine and all should work as before.
6. Note that partitions and filesystems may need a resize.

https://docs.freebsd.org/en/books/handbook/disks/#disks-growing

"dd" program will make byte-to-byte copy of "if" to "of",
status=3Dprogress will show you the progress so you know what happens,
"bs" sets the data chunk size that is important for usb transfers not
to take forever (if you dump a drive over external usb controller).

If you have broken disk with badsectors "ddrescue" is a nice tool that
will retry on failed transfers and tell you which sectors are broken
and skip them to copy what is possible to copy.

when disk is broken sometimes "badblocks" may help in non-destructive
read-only-mode as drive firmware may rewrite silently broken sectors..
just beware that when disk is really badly broken this tool will kill
the disk in seconds so always try the ddrescue in the first place to
rescue as much as possible.

have fun :-)

--=20
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjkU1eP=ao40wrNf1M92L9M8eL%2BtdRAqjFqHNJYmCpnhkw>