On Tue 11 Oct 2011 at 03:38PM, Maidak Alexander J wrote:
> I took a  native zone from Solaris 10 and attempted to v2v migrate it to a 
> Solaris 10 branded zone on Solaris 11 Express 151.0.1.8.
> 
> I just detached the zone from Solaris 10 and did a zfs send|zfs recv for the 
> zonepath dataset (/s10zone/zonepath) to Solaris 11.
> 
> I issued:  "zonecfg -z s10zone create -a /s10zone/zonepath"  To copy over the 
> zonecfg and then changed the brand from native to "solaris10".
> 
> I then moved the orginal Solaris 10 zonepath to /s10zone/s10zonepath, then I 
> attached the zone with the "-d" option as follows:
> 
> root@solaris11:/# zoneadm -z s10zone attach -d /s10zone/s10zonepath/root/
> Log File: /var/tmp/s10zone.attach_log.swaW8f
> Attaching...
> 
> Attach complete.
> Log File: /s10zone/zonepath/root/var/log/s10zone.attach2955.log
> root@solaris11:/# cat /s10zone/zonepath/root/var/log/s10zone.attach2955.log
> [Tuesday, October 11, 2011 01:39:46 PM CDT] Log File: 
> /var/tmp/s10zone.attach_log.swaW8f
> [Tuesday, October 11, 2011 01:39:46 PM CDT] Attaching...
> [Tuesday, October 11, 2011 01:39:46 PM CDT]   Sanity Check: Passed.  Looks 
> like a Solaris 10 image.
> [Tuesday, October 11, 2011 01:39:46 PM CDT ] directory
> [Tuesday, October 11, 2011 01:39:46 PM CDT]
> [Tuesday, October 11, 2011 01:39:46 PM CDT] cd "/s10zone/s10zonepath/root/" 
> && find bin etc export home home1 infrtool kernel lib mnt net none opt 
> platform sbin system usr var  -xdev ( -type d -o -type f -o -type l ) -print |
> [Tuesday, October 11, 2011 01:39:46 PM CDT] cpio -pdm "/s10zone/zonepath/root"
> cpio: Cannot chown() "/s10zone/zonepath/root/etc/globalname", errno 30, 
> Read-only file system
> cpio: Unable to reset modification time for "globalname", errno 30, Read-only 
> file system
> cpio: Cannot chmod() "/s10zone/zonepath/root/etc/globalname", errno 30, 
> Read-only file system
> 11156672 blocks
> 3 error(s)
> [Tuesday, October 11, 2011 01:45:17 PM CDT]   Sanity Check: Passed.  Looks 
> like a Solaris 10 image.
> [Tuesday, October 11, 2011 01:45:17 PM CDT]
> [Tuesday, October 11, 2011 01:45:18 PM CDT] Attach complete.
> 
> Looked like everything went fine, great... Then I noticed that this
> cpio + find method did not migrate the "." files/directories from the
> old zone root into the newly created zone root (example: .ssh). 
> 
> Is this a bug, or were my methods defective?  Advice on this would be
> helpful.
> 

This looks like a bug to me.  In /usr/lib/brand/shared/common.ksh,
install_dir() is responsible for the "cd && find | cpio" that you see
logged above.

 722         list=$(cd "$source_dir" && ls -d * | egrep -v "$filt")
 723         flist=$(for i in $list
 724         do
 725                 printf "%s " "$i"
 726         done)
 727         findopts="-xdev ( -type d -o -type f -o -type l ) -print"
 728 
 729         vlog "cd \"$source_dir\" && find $flist $findopts | "
 730         vlog "cpio $cpioopts \"$ZONEROOT\""
 731 
 732         # Ignore errors from cpio since we expect some errors depending on
 733         # how the archive was made.
 734         ( cd "$source_dir" && find $flist $findopts | \
 735             cpio $cpioopts "$ZONEROOT" )
 736 

The list ($list) generated on line 722 will not include dot files.  It
should probably look like:

             list=$(cd "$source_dir" && ls -A | egrep -v "$filt")

Notice that "ls -d *" changed to "ls -A".  I've opened:

7099779 zoneadm attach -d loses dot files in root directory

-- 
Mike Gerdts
Solaris Core OS / Zones
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to