Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Aug 2013 18:11:27 +0300
From:      "Zeus Panchenko" <zeus@ibs.dn.ua>
To:        <freebsd-fs@freebsd.org>
Subject:   exictent zroot re-alignment to 4K
Message-ID:  <20130827181127.24761@relay.ibs.dn.ua>

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

hi all,

please, I really need help ...

recently I noticed that my netbook HDD has 4K phys sectors and I think
it is worth to use that (is it really worth indeed?)

I have FreeBSD 9-STABLE running well on it already but when it was
installed, the alignment was not done properly ...

=2D --------------------------------------------------------------------
what I have:

> uname -a
FreeBSD 9.1-STABLE #17 r250823: Mon May 20 19:39:19 EEST 2013 amd64

> smartctl -a /dev/ada0
Model Family:     Western Digital Scorpio Black (AF)
Device Model:     WDC WD5000BPKT-60PK4T0
Serial Number:    WD-WXJ1A61P0560
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical

> gpart show ada0
=3D>       34  976773101  ada0  GPT  (465G)
         34          6        - free -  (3.0k)
         40        128     1  freebsd-boot  (64k)
        168   33554432     2  freebsd-swap  (16G)
   33554600  943218528     3  freebsd-zfs  (449G)
  976773128          7        - free -  (3.5k)

> zdb
zroot:
    version: 5000
    name: 'zroot'
    ...
    vdev_tree:
	...
        children[0]:
            type: 'disk'
            id: 0
            path: '/dev/ada0p3'
            phys_path: '/dev/ada0p3'
            whole_disk: 1
            ashift: 9
    ...

> cat /boot/loader.conf
...
vfs.root.mountfrom=3D"zfs:zroot"
...=20=20=20=20



=2D --------------------------------------------------------------------
what I am thinking about:

1. to backup whole zroot
#> zfs send -r zroot@2align > file

2. to plug HDD (let it be detected as adaX) on other system and to:
#> gpart destroy adaX
#> gpart create -s gpt adaX
#> gpart add -b 34 -s 94 -t freebsd-boot -l bootX adaX
#> gpart add -s 4G -t freebsd-swap -l swapX adaX
#> gpart add -a 1m -t freebsd-zfs -l diskX adaX
#> gpart bootcode -b /path/to/backuped/pmbr -p /path/to/backuped/gptzfsboot=
 -i 1 adaX

#> gnop create -S 4096 gtp/diskX
#> zpool create zroot_z-hp gpt/diskX.nop
#> cat file | zfs receive -v zroot_z-hp

#> zpool export zroot_z-hp
#> zpool import -f -o cachefile=3D/tmp/zpool.cache -o altroot=3D/mnt zroot_=
z-hp
#> zfs set mountpoint=3D/root zroot_z-hp
#> cp /tmp/zpool.cache /mnt/root/boot/zfs/zpool.cache
#> vi /mnt/root/boot/loader.conf
  s/zroot/zroot_z-hp/
#> zfs umount /mnt/root
#> zfs set mountpoint=3Dlegacy zroot_z-hp
#> zpool export zroot_z-hp
#> gnop destroy gpt/disk0.nop

#> zpool import -d /dev/gpt/diskX
#> zpool export zroot_z-hp

3. return HDD to the netbook


so, am I right, is it correct way to re-align to 4K an existent ZFS
pool, will it work?

is ZFS version have to be the same on both systems (the one to be
aligned is shown as 5000 (after `zpool upgrade -a') while the one all
that stuff to be performed at is 28)?


=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)

iEYEARECAAYFAlIcwZ4ACgkQr3jpPg/3oyorGgCghK0E/Gl9pAi73V2jFVRk77mU
784AnivFBHqy00i4t+qvTHM1vZdIWqFf
=3DFsRY
=2D----END PGP SIGNATURE-----



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