Re: Resizing partitions on expanded vmware disk

2011-08-20 Thread Nigel Taylor

On 08/20/11 11:05, Yannis Milios wrote:

Ok i created a new scsi hd (30gb) and put it as second disk on vm.
Booted OpenBSD and on boot prompt i gave boot sd0a:/bsd.rd
Then i choose (I) for installation and selected the 2nd disk (sd1).Using
disklabel it automatically created all partitions and i just resized f:
(/usr) partition and gave it extra space by shrinking k: partition (/home)
saved the settings but i did not proceed to the installation,i just reboot
the vm.
I booted normally on sd0 and ran disklabel -h sd0 and then disklabel -h sd1
and i confirmed that partitions are exactly the same on both disks with the
exception of f: (/usr) which now is bigger.So far so good...now i reboot
again boot sd0a/bsd.rd and i select (S) shell option.At this point i am a
bit confused how i will mount the 2 disks and copy all the contents from sd0
to sd1 by using cp command? thank you again




On Sat, Aug 20, 2011 at 11:21 AM, Dmitrij Czarkoffwrote:


The easier way - create a new disc image and use bsd.rd to partition and
label it as needed. When done with it, mount all of Your volumes and use tar
or cp to populate the new image. A side effect of this approach is that You
can test the new image before loosing the old one.




cp does not preserve hard links tar or pax should be used.
You should do something like this to mount and copy..

mount /dev/sd0a /mnt
mount /dev/sd0k /mnt/home
mount /dev/sd0f /mnt/usr
... mount other partitions for disk sd0

mount /dev/sd1a /mnt2
mount /dev/sd1k /mnt2/home
mount /dev/sd1f /mnt2/usr
... mount other partitions for disk sd1

cd /mnt
pax -rw -p e . /mnt2
or tar -cf - . | tar -xphf - -C /mnt2

/usr/mdec/installboot /mnt2/boot /usr/mdec/biosboot sd1



Re: Resizing partitions on expanded vmware disk

2011-08-20 Thread Yannis Milios
Ok i created a new scsi hd (30gb) and put it as second disk on vm.
Booted OpenBSD and on boot prompt i gave boot sd0a:/bsd.rd
Then i choose (I) for installation and selected the 2nd disk (sd1).Using
disklabel it automatically created all partitions and i just resized f:
(/usr) partition and gave it extra space by shrinking k: partition (/home)
saved the settings but i did not proceed to the installation,i just reboot
the vm.
I booted normally on sd0 and ran disklabel -h sd0 and then disklabel -h sd1
and i confirmed that partitions are exactly the same on both disks with the
exception of f: (/usr) which now is bigger.So far so good...now i reboot
again boot sd0a/bsd.rd and i select (S) shell option.At this point i am a
bit confused how i will mount the 2 disks and copy all the contents from sd0
to sd1 by using cp command? thank you again




On Sat, Aug 20, 2011 at 11:21 AM, Dmitrij Czarkoff wrote:

> The easier way - create a new disc image and use bsd.rd to partition and
> label it as needed. When done with it, mount all of Your volumes and use tar
> or cp to populate the new image. A side effect of this approach is that You
> can test the new image before loosing the old one.



Re: Resizing partitions on expanded vmware disk

2011-08-20 Thread Stuart Henderson
On 2011-08-20, Dmitrij Czarkoff  wrote:
> The easier way - create a new disc image and use bsd.rd to partition, label
> and format it as needed. When done with it, mount all of Your volumes and
> use tar or cp to populate the new image.

you could also install on a separate vm and sync files over the network
(perhaps 'ssh dump -0 -f- /partition ... | restore rf -').

whichever way you do it, take care with the root partition; if /boot
moves on the disk you will need to re-run installboot(8) - it might be
simpler to just copy the files in /etc (also take care with fstab if
your partitions are not in the same order on the second disk or if you
use DUIDs rather than the /dev/sd0x format).

> You could also use disklabel and growfs

growfs only lets you expand the end of the filesystem into adjacent space,
it's the wrong tool for this job.



Re: Resizing partitions on expanded vmware disk

2011-08-20 Thread Dmitrij Czarkoff
The easier way - create a new disc image and use bsd.rd to partition, label
and format it as needed. When done with it, mount all of Your volumes and
use tar or cp to populate the new image. A side effect of this approach is
that You can test the new image before loosing the old one.

You could also use disklabel and growfs, but this way You would still want
to backup Your data, so just using a new image is somewhat cleaner.



Resizing partitions on expanded vmware disk

2011-08-20 Thread Yannis Milios
Hello!
I'm testing openbsd 4.9 on vmware workstation 7.0.2.Initially i installed
the system on 10gb scsi disk on vm and openbsd created and sized
automatically all the partitions.Trying to install some packages with
pkg_add i realized that /usr was getting full so i powered off the vm and
expanded the hard disk from 10gb to 20gb sucessfully.Now i'm trying to
recognize how can i expand all partitions automatically or just the /usr
using the new space without loosing the data.I read on FAQ that there is a
way it can be done using disklabel and newfs but i should move all the data
on a temporary location,create new partition size and the move them back.It
seems ok but i would prefer the extra 10gb space to be applied on all
partitions accordingly and not just to one of them.I hope you understand
what i'm trying to say cause my english are not very good :) thank you