{"id":808,"date":"2010-04-08T15:19:01","date_gmt":"2010-04-08T20:19:01","guid":{"rendered":"http:\/\/www.gamescheat.ca\/?p=808"},"modified":"2019-09-04T19:57:39","modified_gmt":"2019-09-05T00:57:39","slug":"how-to-relocate-the-export-and-exporthome-filesystems-on-solaris-10","status":"publish","type":"post","link":"http:\/\/www.gamescheat.ca\/?p=808","title":{"rendered":"How to relocate the \/export and \/export\/home filesystems on Solaris 10."},"content":{"rendered":"<p>By default Solaris installs the \/export and \/export\/home filesystems in the root zfs pool, if you picked ZFS and not UFS as the filesystem. I wanted to relocate \/export and \/export\/home to a larger ZFS pool other than the root pool as I wanted to separate the user\u2019s data from the OS.<\/p>\n<p>The first thing to do is determine the available disk and slice.  Use the format command to list the disks and slices.<\/p>\n<blockquote><p># format<br \/>\nSearching for disks\u2026done<\/p>\n<p>AVAILABLE DISK SELECTIONS:<br \/>\n       0. c0t0d0 <FUJITSU-MBD2147RC-3701-136.73GB><br \/>\n          \/pci@0,600000\/pci@0\/pci@0\/scsi@0\/sd@0,0<br \/>\n       1. c0t1d0 <FUJITSU-MBD2147RC-3701-136.73GB><br \/>\n          \/pci@0,600000\/pci@0\/pci@0\/scsi@0\/sd@1,0<br \/>\n       2. c3t60060E8005652C000000652C00002100d0 <HITACHI-OPEN-V-SUN-6006 cyl 65533 alt 2 hd 15 sec 1066><br \/>\n          \/scsi_vhci\/ssd@g60060e8005652c000000652c00002100<br \/>\nSpecify disk (enter its number):<\/p><\/blockquote>\n<blockquote><p># zpool create epool c3t60060E8005652C000000652C00002100d0s7<\/p><\/blockquote>\n<p>This will create the zfs pool called epool on disk c3t60060E8005652C000000652C00002100d0, slice 7.<\/p>\n<p>Confirm that the pool was created with the command zpool list.<\/p>\n<blockquote><p>bash-3.00# zpool list<br \/>\nNAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT<br \/>\nepool   472G   174K   472G     0%  ONLINE  \u2013<br \/>\nrpool  25.5G  5.41G  20.1G    21%  ONLINE  \u2013<\/p><\/blockquote>\n<p>Create a snapshot of \/export and \/export\/home.  The -r option created a recursive snapshot, so you do not have to manually create the snapshot for \/export\/home as well.<\/p>\n<blockquote><p># zfs snapshot -r rpool\/export@snapshot<\/p><\/blockquote>\n<p>Confirm that the snapshots were crearted, they are rpool\/export@snapshot and rpool\/export\/home@snapshot.<\/p>\n<blockquote><p># zfs list<br \/>\nNAME                         USED  AVAIL  REFER  MOUNTPOINT<br \/>\nepool                         72K   465G    21K  \/epool<br \/>\nrpool                       7.41G  17.7G    97K  \/rpool<br \/>\nrpool\/ROOT                  4.41G  17.7G    21K  legacy<br \/>\nrpool\/ROOT\/zfsboot          4.41G  17.7G  4.35G  \/<br \/>\nrpool\/ROOT\/zfsboot\/var      69.2M  17.7G  69.2M  \/var<br \/>\nrpool\/dump                  1.00G  17.7G  1.00G  \u2013<br \/>\nrpool\/export                  44K  17.7G    23K  \/export<br \/>\nrpool\/export@snapshot           0      \u2013    23K  \u2013<br \/>\nrpool\/export\/home             21K  17.7G    21K  \/export\/home<br \/>\nrpool\/export\/home@snapshot      0      \u2013    21K  \u2013<br \/>\nrpool\/swap                     2G  19.7G    16K  \u2013<\/p><\/blockquote>\n<p>Now restore the snapshots to the new zfs pool called epool.<\/p>\n<blockquote><div style=\"float: right;\"><div style=\"margin: 15px 15px 15px 15px\";><script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-3319935785736004\";\ngoogle_alternate_color = \"FFFFFF\";\ngoogle_ad_width = 250;\ngoogle_ad_height = 250;\ngoogle_ad_format = \"250x250_as\";\ngoogle_ad_type = \"text_image\";\ngoogle_ad_channel =\"\";\ngoogle_color_border = \"cccccc\";\ngoogle_color_link = \"cc0000\";\ngoogle_color_bg = \"ffffff\";\ngoogle_color_text = \"000000\";\ngoogle_color_url = \"008000\";\n\/\/--><\/script>\n<script type=\"text\/javascript\"\n  src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><\/div><\/div><p># zfs send rpool\/export@snapshot | zfs receive epool\/export<br \/>\n# zfs send rpool\/export\/home@snapshot | zfs receive epool\/export\/home<\/p><\/blockquote>\n<p>Confirm that the snapshots were restored to epool.<\/p>\n<blockquote><p># zfs list<br \/>\nNAME                         USED  AVAIL  REFER  MOUNTPOINT<br \/>\nepool                        134K   465G    23K  \/epool<br \/>\nepool\/export                  44K   465G    23K  \/epool\/export<br \/>\nepool\/export@snapshot           0      \u2013    23K  \u2013<br \/>\nepool\/export\/home             21K   465G    21K  \/epool\/export\/home<br \/>\nepool\/export\/home@snapshot      0      \u2013    21K  \u2013<br \/>\nrpool                       7.41G  17.7G    97K  \/rpool<br \/>\nrpool\/ROOT                  4.41G  17.7G    21K  legacy<br \/>\nrpool\/ROOT\/zfsboot          4.41G  17.7G  4.35G  \/<br \/>\nrpool\/ROOT\/zfsboot\/var      69.2M  17.7G  69.2M  \/var<br \/>\nrpool\/dump                  1.00G  17.7G  1.00G  \u2013<br \/>\nrpool\/export                  44K  17.7G    23K  \/export<br \/>\nrpool\/export@snapshot           0      \u2013    23K  \u2013<br \/>\nrpool\/export\/home             21K  17.7G    21K  \/export\/home<br \/>\nrpool\/export\/home@snapshot      0      \u2013    21K  \u2013<br \/>\nrpool\/swap                     2G  19.7G    16K  \u2013<\/p><\/blockquote>\n<p>Now you need to redirect the mount points for \/export and \/export\/home.  They are still pointing to rpool\/export and rpool\/export\/home.  List the mount points with the zfs mount command.<\/p>\n<blockquote><p># zfs mount<br \/>\nrpool\/ROOT\/zfsboot              \/<br \/>\nrpool\/ROOT\/zfsboot\/var          \/var<br \/>\nepool                           \/epool<br \/>\nrpool\/export                    \/export<br \/>\nrpool\/export\/home               \/export\/home<br \/>\nrpool                           \/rpool<br \/>\nepool\/export                    \/epool\/export<br \/>\nepool\/export\/home               \/epool\/export\/home<\/p><\/blockquote>\n<p>Unmount \/export and \/export\/home becasue they are currently mounted.<\/p>\n<blockquote><p># zfs unmount \/export\/home<br \/>\n# zfs unmount \/export<\/p><\/blockquote>\n<p>Now redirect the mount point \/export to epool\/export.<\/p>\n<blockquote><p># zfs set mountpoint=\/export epool\/export<\/p><\/blockquote>\n<p>Redirect the mount point \/export\/home to epool\/export\/home.                      <\/p>\n<blockquote><p># zfs set mountpoint=\/export\/home epool\/export\/home                <\/p><\/blockquote>\n<p>Confirm the changes.<\/p>\n<blockquote><p># zfs mount<br \/>\nrpool\/ROOT\/zfsboot              \/<br \/>\nrpool\/ROOT\/zfsboot\/var          \/var<br \/>\nepool                           \/epool<br \/>\nrpool                           \/rpool<br \/>\nepool\/export                    \/export<br \/>\nepool\/export\/home               \/export\/home<\/p><\/blockquote>\n<p>Reboot the server for the changes to take effect.<\/p>\n<p>After the server restarts list the filesystems to confirm the changes.<\/p>\n<blockquote><p># zfs list<br \/>\nNAME                         USED  AVAIL  REFER  MOUNTPOINT<br \/>\nepool                        219K   465G    21K  \/epool<br \/>\nepool\/export                  84K   465G    23K  \/export<br \/>\nepool\/export@snapshot         21K      \u2013    23K  \u2013<br \/>\nepool\/export\/home             40K   465G    22K  \/export\/home<br \/>\nepool\/export\/home@snapshot    18K      \u2013    21K  \u2013<br \/>\nrpool                       7.42G  17.7G    99K  \/rpool<br \/>\nrpool\/ROOT                  4.42G  17.7G    21K  legacy<br \/>\nrpool\/ROOT\/zfsboot          4.42G  17.7G  4.35G  \/<br \/>\nrpool\/ROOT\/zfsboot\/var      69.3M  17.7G  69.3M  \/var<br \/>\nrpool\/dump                  1.00G  17.7G  1.00G  \u2013<br \/>\nrpool\/export                  75K  17.7G    23K  \/export<br \/>\nrpool\/export@snapshot         16K      \u2013    23K  \u2013<br \/>\nrpool\/export\/home             36K  17.7G    21K  \/export\/home<br \/>\nrpool\/export\/home@snapshot    15K      \u2013    21K  \u2013<br \/>\nrpool\/swap                     2G  19.7G    16K  \u2013<\/p><\/blockquote>\n<p>You need to delete the old \/export and \/export\/home which are pointing to rpool\/export and rpool\/export\/home respectively.<\/p>\n<blockquote><p># zfs destroy -r rpool\/export<\/p><\/blockquote>\n<p>Confirm the filesystems were deleted.<\/p>\n<blockquote><p># zfs list<br \/>\nNAME                         USED  AVAIL  REFER  MOUNTPOINT<br \/>\nepool                        219K   465G    21K  \/epool<br \/>\nepool\/export                  84K   465G    23K  \/export<br \/>\nepool\/export@snapshot         21K      \u2013    23K  \u2013<br \/>\nepool\/export\/home             40K   465G    22K  \/export\/home<br \/>\nepool\/export\/home@snapshot    18K      \u2013    21K  \u2013<br \/>\nrpool                       7.42G  17.7G    99K  \/rpool<br \/>\nrpool\/ROOT                  4.42G  17.7G    21K  legacy<br \/>\nrpool\/ROOT\/zfsboot          4.42G  17.7G  4.35G  \/<br \/>\nrpool\/ROOT\/zfsboot\/var      69.3M  17.7G  69.3M  \/var<br \/>\nrpool\/dump                  1.00G  17.7G  1.00G  \u2013<br \/>\nrpool\/swap                     2G  19.7G    16K  \u2013<\/p><\/blockquote>\n<p>Delete the snapshots to free up space in the zfs pool rpool.<\/p>\n<blockquote><p># zfs destroy epool\/export@snapshot<br \/>\n# zfs destroy epool\/export\/home@snapshot<\/p><\/blockquote>\n<p>Confirm the snapshots were deleted.<\/p>\n<blockquote><p># zfs list<br \/>\nNAME                     USED  AVAIL  REFER  MOUNTPOINT<br \/>\nepool                    153K   465G    21K  \/epool<br \/>\nepool\/export              45K   465G    23K  \/export<br \/>\nepool\/export\/home         22K   465G    22K  \/export\/home<br \/>\nrpool                   7.42G  17.7G    99K  \/rpool<br \/>\nrpool\/ROOT              4.42G  17.7G    21K  legacy<br \/>\nrpool\/ROOT\/zfsboot      4.42G  17.7G  4.35G  \/<br \/>\nrpool\/ROOT\/zfsboot\/var  69.3M  17.7G  69.3M  \/var<br \/>\nrpool\/dump              1.00G  17.7G  1.00G  \u2013<br \/>\nrpool\/swap                 2G  19.7G    16K  \u2013<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>By default Solaris installs the \/export and \/export\/home filesystems in the root zfs pool, if you picked ZFS and not UFS as the filesystem. I wanted to relocate \/export and \/export\/home to a larger ZFS pool other than the root&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/www.gamescheat.ca\/?p=808\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[76,64],"_links":{"self":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/808"}],"collection":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=808"}],"version-history":[{"count":3,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions"}],"predecessor-version":[{"id":966,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions\/966"}],"wp:attachment":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=808"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}