Thursday, November 02, 2023

Re: odd homework looking to upgrade sticks..

Thanking Crystal again for the precious tips, it appears I just solved!


And so I finally *melt* my OpenBSD system for a 32gb, more or less,
(59000000 sectors of a 64gb key 120000000 sectors) that I will go to
copy by my copy machine onto my new 32gb sticks arriving soon.

Here the steps I followed:

0. I prepared a note with the new stick layout I would like to realize
on the 32gb sticks including partition name, offsets, sizes, etc.
1. copymachine: I copied my 16gb stick into my target stick (the 64gb).
2. fdisk: I incrised the size of the logical partition containing
OpenBSD to about 59000000 sectors that I will hope will fit in the
new 32gb sticks. I did so without touching any cylinder, head or
sector parameters that automatically adapted to the new size..
3. disklabel: I incrised the boundaries of OpenBSD to reach the
59000000 sectors.
4. disklabel: I erased all the existing partitions.
5. disklabel: I created the new stick layout as from the note above.
6. I *newfs* all the the used partitions.
7. I repeated for every partition needing to be file populated with the
following *pax copy steps*:

cd /tmp
umount /mnt/oldkey
umount /mnt/newkey
mount -t ffs /dev/sd1a /mnt/oldkey
mount -t ffs /dev/sd2a /mnt/newkey
cd /mnt/oldkey
pax -rw -pe . /mnt/newkey/

8. installboot: I launched it in this way to prevent any boot problem:

installboot -v -r /mnt/neykey sd2 /usr/mdec/biosboot /usr/mdec/boot

9. I rebooted the pc in the new stick to test the resulting system.
a. I recovered all the immutable flags on the pertaining locked down
files.


Actually not a problem, I hope this is helpful to someone.


== Daniele Bonini


> On Thu, Nov 02, 2023 at 04:33:32PM +0100, Daniele B. wrote:
> > 1. Copymachine: copy from the old 16gb stick (sd2) to the new 64gb
> > stick (sd1) to get the stick layout.
> > 2. disklabel -E: I then delete all the partitions.
> > 3. disklabel -E: I recreate a bigger / partition (sd1a).
> > 4. disklabel -E: I recreate a the swap partition (sd1b).
>
> This makes no sense.
>
> The way you are trying to do this is over-complicated and going to
> cause you other problems later on.
>
> For example:
>
> > pax -rw . /mnt/newstick/
>
> This will not copy the file flags, so the files that you have set as
> immutable will no longer be immutable. And you probably would not
> be expecting that.
>
> On Thu, Nov 02, 2023 at 04:43:19PM +0100, Daniele B. wrote:
> > Ok, I did
> >
> > wiz# installboot -v -r /mnt/key sd1
> >
> > receiving:
> > Using /mnt/key as root
> > installboot: realpath: No such file or directory
>
> This is because you don't have:
>
> /mnt/key/usr/mdec/boot
>
> and
>
> /mnt/key/usr/mdec/biosboot
>
> > But doing as from the man:
> >
> > wiz# installboot -v -r /mnt/key sd1 /usr/mdec/biosboot
> > /usr/mdec/boot
>
> This works because you are copying those files from your original
> installation.
>
> But it is not clear whether your new 'stick' has a suitable root file
> system on it or not.
>
> Daniele, take my advice - you are hopelessly out of your depth here,
> just do a FRESH INSTALL on the new 64 Gb stick, and install the
> packages that you use, then copy your old configuration files and
> data from the 16 Gb stick afterwards.
>
> DON'T try to do it the way you are trying to, because you'll just
> mess it up, and spend the next week posting to -misc asking why it
> doesn't work.
>

No comments:

Post a Comment