Creating OpenSolaris CLI JeOS RNJS by Uninstall

Note: Because in Amazon EC2 we can't update Kernel and Ramdisk plus OpenSolaris store ZFS pool configuration in Ramdisk in form of ZFS cache you will not be able at least for now to upload your images. You need to use our preprepared JeOS image:

This entry is part of 'OpenSolaris on Amazon EC2' workshop

1. Boot into right OpenSolaris image

2. Generate list of all installed packages

pkg list -s >/install.lst

And make diff with CLIinst file as 'remove.lst'

3. Apply workaround for system files

Workaround: Uninstalling slim_cd cluster will remove /etc/passwd and /etc/shadow, even when they belong also into SUNWcs

cat allfiles.lst | grep slim_cd
slim_cd                       etc/X11/gdm/custom.conf
slim_cd                       etc/pam.conf
slim_cd                       etc/passwd
slim_cd                       etc/shadow
slim_cd                       etc/user_attr

cat allfiles.lst | grep etc/passwd
SUNWcs                        etc/passwd
slim_cd                       etc/passwd

cp /etc/pam.conf /etc/pam.conf.bck
cp  /etc/passwd /etc/passwd.bck
cp  /etc/shadow /etc/shadow.bck
cp /etc/user_attr /etc/user_attr.bck

3. Remove ZFS snapshots from install time

zfs list
NAME                                 USED  AVAIL  REFER  MOUNTPOINT
rpool                               2.57G  6.04G    55K  /rpool
rpool@install                         16K      -    55K  -
rpool/ROOT                          2.57G  6.04G    18K  /rpool/ROOT
rpool/ROOT@install                      0      -    18K  -
rpool/ROOT/opensolaris              2.57G  6.04G  2.50G  legacy
rpool/ROOT/opensolaris@install      59.4M      -  2.48G  -
rpool/ROOT/opensolaris/opt          12.8M  6.04G  12.8M  /opt
rpool/ROOT/opensolaris/opt@install    49K      -  3.61M  -
rpool/export                          72K  6.04G    19K  /export
rpool/export@install                  15K      -    19K  -
rpool/export/home                     38K  6.04G    18K  /export/home
rpool/export/home@install             20K      -    21K  -

zfs destroy rpool@install
zfs destroy rpool/ROOT@install
zfs destroy rpool/ROOT/opensolaris@install
zfs destroy rpool/ROOT/opensolaris/opt@install
zfs destroy rpool/export@install
zfs destroy rpool/export/home@install

4. Switch to single mode (Permanently)

svcadm milestone -d milestone/single-user:default

5. Uninstall packages using remove.lst

cat /remove.lst | awk '{ print $1 }' | xargs pkg uninstall

6. Clean unnecessary config files

rm -f -r /var/pkg/lost+found/

7. Check resulted size

 zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
rpool                        635M  7.99G    55K  /rpool
rpool/ROOT                   634M  7.99G    18K  /rpool/ROOT
rpool/ROOT/opensolaris       634M  7.99G   622M  legacy
rpool/ROOT/opensolaris/opt  12.7M  7.99G  12.7M  /opt
rpool/export                  37K  7.99G    19K  /export
rpool/export/home             18K  7.99G    18K  /export/home

8. Fix system files in /etc/\*

cp /etc/pam.conf.bck /etc/pam.conf
cp  /etc/passwd.bck /etc/passwd
cp  /etc/shadow.bck /etc/shadow
cp /etc/user_attr.bck /etc/user_attr

9. Check installed packages

pkg list -s | wc -l
     112

pkg verify | egrep "pkg:|depend:"

10. Check services on reboot

init 6 

svcs -xv 

None listed 

Switch to user level 

svcadm milestone -d all

svcs -xv 

You will see bunch of GUI related services in maintenace mode like font cache and so on, disable them

svcadm disable {service FMRI }

Make clean reboot with

 init 6

11. You are done, backup me

PS: In some case you will like to create back ZFS install snapshots, so use:

  zfs snapshot rpool@install
  zfs snapshot rpool/ROOT@install
  zfs snapshot rpool/ROOT/opensolaris@install
  zfs snapshot rpool/ROOT/opensolaris/opt@install
  zfs snapshot rpool/export@install
  zfs snapshot rpool/export/home@install
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Hands-on experience with Virtualization

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today