# Moving to larger hard disk



## bnorton916 (Nov 6, 2013)

Freebsd 9.X is installed on a SPARC system. Everything is going fine but I want to move the boot drive to a larger boot drive(18GB ==> 300GB).


```
[CMD]gpart create -s gpt da1[/CMD]
da1 created
```


```
[CMD]gpart add -t freebsd-boot -l gpboot -b 40 -s 512K da0[/CMD]
da1p1 added
```
`gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da1`

But pmbr and gptboot do not exist in /boot. Only boot1 and zfsboot. I noticed my x86 freebsd FreeBSD box does have pmbr and gptboot in the /boot directory. Is there something missing because of a SPARC install?

Any advice?

Bill


----------



## wblock@ (Nov 6, 2013)

Can a SPARC system deal with GPT, or will it want VTOC8?  What does `gpart show` on the existing disk show?


----------



## bnorton916 (Nov 6, 2013)

```
[cmd]# gpart show [/cmd]
=>       0  35343000  da0  VTOC8  (16G)
         0  33543720    1  freebsd-ufs  (16G)
  33543720   1751085    2  freebsd-swap  (855M)
  35294805     48195       - free -  (23M)

=>       34  585937433  da1  GPT  (279G)
         34          6       - free -  (3.0k)
         40       1024    1  freebsd-boot  (512k)
       1064  585936403       - free -  (279G)
```


----------



## wblock@ (Nov 6, 2013)

Yes, it wants VTOC8.  Unfortunately, I know nothing more about VTOC8 than that it exists.  gpart can create the same type of disk:

```
# gpart destroy -F da1
# gpart create -s vtoc8 da1
# gpart add -t freebsd-ufs -s 275g da1
# gpart add -t freebsd-swap da1
```

Untested, of course.  That may not boot, depending on how the SPARC systems handle bootcode.  Come to think of it, you may not be booting from da0, either.


----------



## bnorton916 (Nov 6, 2013)

I found some posts that used the above commands after you mentioned VTOC8. Also found `sunlabel`. We will see if this works.


----------



## bnorton916 (Nov 7, 2013)

Thanks @wblock@, you set me on the correct path.

I am listing the steps I took for future reference, and if I made a mistake please let me know.

First, I removed any partition information using `sysinstall`


```
sunlabel -B da1
gpart destroy -F da1
gpart create -s vtoc8 da1
gpart add -s 50G -t freebsd-ufs /dev/da1
gpart add -s 1G -t freebsd-swap /dev/da1
gpart add -t freebsd-zfs /dev/da1
mkdir /bill
newfs -m 0 /dev/da1a
mount /dev/da1a /bill
( dump -0f - / ) | ( cd /bill ; restore -rf - )
```
It was on a live system, not recommended, but nothing was happening on this system. The dump took a[]while, I then `shutdown`. I removed the 18 GB drive and replaced it with the 300 GB drive. It booted and so far everything looks good.


----------



## wblock@ (Nov 7, 2013)

The first step installs bootcode, which should probably be done after creating the partitioning scheme.  gpart(8) might be able to do it.

dump(8) goes much, much faster with an increased buffer size: http://www.wonkity.com/~wblock/docs/html/backup.html#_useful_code_dump_code_options.  But don't go with a value larger than -b64.


----------

