add a new partition in USB

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

add a new partition in USB

Tuyosi Takesima
Hi all .

i have 32GB USB memory . and this is clone of ' 2GB live USB '.
so i want to extend 'this clone 2GB' to about 8GB .
in order to this , i want to make  ' partion d ' in 32GB USB .
so i do next steps .

# fdisk -e sd0
fdisk: 1> edit 0
Partition id ('0' to disable) [0 - FF]: [0] (? for help) 1
fdisk: 1> setpid 0
Partition id ('0' to disable) [0 - FF]: [1] (? for help) A6
fdisk:*1> w
fdisk: MBR contains more than one OpenBSD partition!  <------- attention
Write MBR anyway? [n] y

now
# fdisk -e sd0
fdisk: 1> p
Disk: sd0       geometry: 3840/255/63 [61702144 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: A6    243   0   1 -   1000   0   1 [     3903795:    12161206 ] OpenBSD
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
*3: A6      0   1   2 -    242 254  63 [          64:     3903731 ] OpenBSD


i want to make partition d in
'  #0  243   0   1 -   1000   0   1 OpenBSD ' .


----------------------
i try
# disklabel -E sd0
> p
OpenBSD area: 3903795-16065001; size: 12161206; free: 12161206
#                size           offset  fstype [fsize bsize  cpg]
  c:         61702144                0  unused


this is strange to me because i already had a
 in ' #3: A6      0   1   2 -    242 254  63  OpenBSD '.
 but thre is no ' partition a '

what should i do next to make ' partion d' in 32GB USB ?
and where is ' partition a ' ?

----
tuyosi

Reply | Threaded
Open this post in threaded view
|

Re: add a new partition in USB

Nick Holland
On 07/22/14 19:09, Tuyosi Takesima wrote:
> Hi all .
>
> i have 32GB USB memory . and this is clone of ' 2GB live USB '.
> so i want to extend 'this clone 2GB' to about 8GB .
> in order to this , i want to make  ' partion d ' in 32GB USB .
> so i do next steps .
>
> # fdisk -e sd0
...
no no no.

You need to read http://www.openbsd.org/faq/faq14.html
and read what is actually there, not what you think is there.

You can only have one OpenBSD fdisk partition...and the answers to your
questions are in the above link.

Nick.

Reply | Threaded
Open this post in threaded view
|

Re: add a new partition in USB

Tuyosi Takesima
In reply to this post by Tuyosi Takesima
Hi, all.

till iread Nick's reply , i make clone 32GB USB from 2GB USB by dd.
and am  making new partition on 32G USB .
but fail ,fail ,

from now i change strategy .
erase 32GB USB completely , and make a partition ,and copy files
from 2GB to 32GB .

2G USB is recognized as sd0 by amd64 openbsd machine.
32G USB is sd1 .

disklabel  -E sd1
d *
A
and erese k etc .
(i can't make big size a partition directly .
 some technique is needed )

result is next .

> p
OpenBSD area: 0-61702144; size: 61702144; free: 51692144
#                size           offset  fstype [fsize bsize  cpg]
  a:         10000000         39486816  4.2BSD   2048 16384    1
  b:            10000                0    swap
  c:         61702144                0  unused
> q


# mkdir /mnt0
# mkdir /mnt1

# newfs sd1a

# mount /dev/sd0a /mnt0
# mount /dev/sd1a /mnt1

# cp -r /mnt0/* /mnt1
 or
 (cd /mnt0; tar cvpf - .)|(cd /mnt1 ; tar xpf -)
the latter  may be much  faster .

regretably ,
# cd /usr/mdec; ./installboot /mnt1/boot biosboot sd1
ksh: ./installboot: not found
FAIL


# /usr/sbin/installboot /mnt1/boot  /usr/mdec/biosboot sd1
installboot: disklabel: /mnt1/boot: Inappropriate ioctl for device
also FAIL .

pehaps
umount /mnt0
umount /mnt1
continue .

what is ' appropriate ioctl for device ' ?
---
tuyosi