Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Sep 2008 22:12:54 +0400 (MSD)
From:      Dmitry Morozovsky <marck@rinet.ru>
To:        Stanislav Sedov <stas@FreeBSD.org>
Cc:        freebsd-fs@FreeBSD.org, marcel@FreeBSD.org
Subject:   Re: gpt in-place editing
Message-ID:  <alpine.BSF.2.00.0809222202460.94747@woozle.rinet.ru>
In-Reply-To: <20080921140932.adf51b5e.stas@FreeBSD.org>
References:  <alpine.BSF.2.00.0809170054290.19038@woozle.rinet.ru> <20080921140932.adf51b5e.stas@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 21 Sep 2008, Stanislav Sedov wrote:

SS> > is there a way to split existing GPT partition into two, like one can do in 
SS> > bsdlabel case?
SS> > 
SS> > I found myself wanting to shrink swap to have an alternate root, but have no 
SS> > luck in my experiments.
SS> > 
SS> > For the reference, I have
SS> > 
SS> > da0p1	boot
SS> > da0p2	bootdisk
SS> > da0p3	swap
SS> > da0p4	ZFS
SS> > 
SS> > and want to place two partitions in place of da0p3...
SS> 
SS> You can simpy remove the da0p3 partition and add two new instead of it.

It does not seem gpart wants allow me to delete da0p3 while disk is active...

gpt did the trick though, with sysctl kern.geom.debugflags=16

root@beaver:/# gpt remove -i 3 da0
da0p3 removed
root@beaver:/# gpt show da0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34         128      1  GPT part - FreeBSD boot
         162     1048576      2  GPT part - FreeBSD UFS/UFS2
     1048738    33554432
    34603170  4359862077      4  GPT part - FreeBSD ZFS
  4394465247          32         Sec GPT table
  4394465279           1         Sec GPT header
root@beaver:/# gpt add -s 1048576 -t ufs da0
root@beaver:/# gpt show da0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34         128      1  GPT part - FreeBSD boot
         162     1048576      2  GPT part - FreeBSD UFS/UFS2
     1048738     1048576      3  GPT part - FreeBSD UFS/UFS2
     2097314    32505856
    34603170  4359862077      4  GPT part - FreeBSD ZFS
  4394465247          32         Sec GPT table
  4394465279           1         Sec GPT header
root@beaver:/# gpt add -t swap da0


BUT - 

system missed part 5:

root@beaver:/# gpt show da0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34         128      1  GPT part - FreeBSD boot
         162     1048576      2  GPT part - FreeBSD UFS/UFS2
     1048738     1048576      3  GPT part - FreeBSD UFS/UFS2
     2097314    32505856      5  GPT part - FreeBSD swap
    34603170  4359862077      4  GPT part - FreeBSD ZFS
  4394465247          32         Sec GPT table
  4394465279           1         Sec GPT header
root@beaver:/# gpart show
=>        34  4394465213  da0  GPT  (2.2TB)
          34         128    1  freebsd-boot  (65.5KB)
         162     1048576    2  freebsd-ufs  (536.9MB)
     1048738    33554432    3  freebsd-swap  (17.2GB)
    34603170  4359862077    4  freebsd-zfs  (2.2TB)

root@beaver:/# ls /dev/da0*
/dev/da0    /dev/da0p1  /dev/da0p2  /dev/da0p3  /dev/da0p4


Marcel, can you please comment too?  Thanks.

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck@FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0809222202460.94747>