Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Aug 2013 14:58:17 +0300
From:      "Zeus Panchenko" <zeus@ibs.dn.ua>
To:        <freebsd-fs@freebsd.org>
Subject:   Re: exictent zroot re-alignment to 4K (end of story - final recipe)
Message-ID:  <20130829145817.43833@relay.ibs.dn.ua>
In-Reply-To: Your message of Tue, 27 Aug 2013 18:11:27 %2B0300 <20130827181127.24761@relay.ibs.dn.ua>
References:  <20130827181127.24761@relay.ibs.dn.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi all,

here is what I did and now I am happy with my ashifted to 12 zroot on my
netbook

1. Backup existent data
   zfs send -R zroot > latest.snap
   zpool export zroot

2. Destroy/Create partitions
   gpart destroy ada1
   gpart create -s gpt ada1
   gpart add -b 34 -s 94 -t freebsd-boot -l z-hp_boot ada1

   here it was surprise for me since gpart complained and I had to issue
   another options

   #> gpart add -b 34 -s 94 -t freebsd-boot -l z-hp_boot ada1
   ada1p1 added, but partition is not aligned on 4096 bytes
   #> gpart add -s 64K -t freebsd-boot -l z-hp_boot ada1
   ada1p1 added

   gpart add -s 4G -t freebsd-swap -l z-hp_swap ada1
   gpart add -a 1m -t freebsd-zfs -l z-hp_disk ada1
   gpart bootcode -b /path/to/backuped/pmbr -p /path/to/backuped/gptzfsboot=
 -i 1 ada1

3. Create zpool and restore backup
   gnop create -S 4096 gpt/z-hp_disk
   zpool create z-hp_zroot gpt/z-hp_disk.nop
   cat latest.snap | zfs receive -Fv z-hp_zroot

4. Heal new zpool
   zpool export z-hp_zroot
   zpool import -f -o cachefile=3D/tmp/zpool.cache -o altroot=3D/mnt z-hp_z=
root
   zfs set mountpoint=3D/ z-hp_zroot
   cp /tmp/zpool.cache /mnt/boot/zfs/zpool.cache

   vi /mnt/boot/loader.conf
   change vfs.root.mountfrom=3D"zfs:zroot" =3D> vfs.root.mountfrom=3D"zfs:z=
-hp_zroot"
   vi /mnt/etc/fstab
   change /dev/gpt/swap0.eli =3D> /dev/gpt/z-hp_swap.eli

   zfs umount /mnt
   zfs set mountpoint=3Dlegacy z-hp_zroot
   zpool export z-hp_zroot

5. Removing gnop
   gnop destroy gpt/z-hp_disk.nop

and now I have my system undamaged and zdb shows:
z-hp_zroot:
    version: 5000
    name: 'z-hp_zroot'
    ...
    vdev_tree:
        type: 'root'
	...
        children[0]:
            type: 'disk'
	    ...
            path: '/dev/ada0p3'
            phys_path: '/dev/ada0p3'
            whole_disk: 1
            ashift: 12
	    ...

thanks much to all

=2D --=20
Zeus V. Panchenko				jid:zeus@im.ibs.dn.ua
IT Dpt., I.B.S. LLC					  GMT+2 (EET)
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlIfN1gACgkQr3jpPg/3oyr5awCeOzHIFdxR7rZ60CJw9qQ71ePd
uQ4An07Xs2extRRDbG/vijgZ7WjNIaTZ
=3Dy5yh
=2D----END PGP SIGNATURE-----



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