Howto Unmirror a File System That Cannot Be Unmounted Solaris 10 February 27, 2008
Posted by invaleed in Solaris.1 comment so far
Use this task to unmirror file systems, including root (/), /usr, /opt, and swap, that cannot be unmounted during normal system operation.
- Make sure that you have root privilege and that you have a current backup of all data.
- Verify that at least one submirror is in the Okay state.
- Detach the submirror that will continue to be used for the file system.
- Use one of the following commands, depending the file system you want to unmirror:
- For the /usr, /opt, or swap file systems, change the file system entry in the /etc/vfstab file to use a non-Solaris Volume Manager device (slice).
- For the root (/) file system only: run the metaroot command.
- Reboot the system.
- Clear the remaining mirror and submirrors.
# metastat mirror
# metadetach mirror submirror
# metaroot rootslice
# reboot
# metaclear -r mirror
Example Unmirroring the root (/) File System
# metastat d0
d0: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d20
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 40541184 blocks (19 GB)d10: Submirror of d0
State: Okay
Size: 40541184 blocks (19 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yesd20: Submirror of d0
State: Okay
Size: 40541184 blocks (19 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s0 0 No Okay Yes
# metadetach d0 d20
d0: submirror d20 is detached
# metaroot /dev/dsk/c0t0d0s0
# reboot
# metaclear -r d0
d0: Mirror is cleared
d10: Concat/Stripe is cleared
# metaclear d20
d20: Concat/Stripe is cleared
Example Unmirroring the swap File System
# metastat d1
d1: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d21
State: Okay
# metadetach d1 d21
d1: submirror d21 is detached
Edit the /etc/vfstab file to change the entry for swap from metadevice to slice name
# vi /etc/vfstab
In this example, the /etc/vfstab file contains the following entry for the swap file system:
/dev/md/dsk/d1 – – swap – no -
Change the entry to read as follows:
/dev/dsk/c0t0d0s1 – – swap – no -
# reboot
# metaclear -r d1
d1: Mirror is cleared
d11: Concat/Stripe is cleared
# metaclear d21
d21: Concat/stripe is cleared
Howto Unmirror a File System that can be unmounted Solaris 10 February 27, 2008
Posted by invaleed in Solaris.add a comment
Use this procedure to unmirror a file system that can be unmounted while the system is running.
To unmirror root (/), /var, /usr, or swap, or any other file system that cannot be unmounted while the system is running
- Make sure that you have root privilege and that you have a current backup of all data.
- Verify that at least one submirror is in the Okay state.
- Unmount the file system.
- Detach the submirror that will continue to be used for the file system.
- Clear the mirror and remaining subcomponents.
- Edit the /etc/vfstab file to use the component detached in Step4 , if necessary.
- Remount the file system.
# metastat mirror
# umount /file-system
# metadetach mirror submirror
# metaclear -r mirror
# mount /file-system
Example : Unmirroring the /opt File System
# metastat d3
d3: Mirror
Submirror 0: d13
State: Okay
Submirror 1: d23
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 31464192 blocks (15 GB)d13: Submirror of d3
State: Okay
Size: 31464192 blocks (15 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s3 0 No Okay Yesd23: Submirror of d3
State: Okay
Size: 31464192 blocks (15 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s3 0 No Okay Yes
# umount /opt
# metadetach d3 d13
d3: submirror d13 is detached
# metaclear -r d3
d3: Mirror is cleared
d23: Concat/Stripe is cleared
Edit the /etc/vfstab file so that the entry for /opt is changed from d3 to the underlying slice or volume
# mount /opt
Reset Password root Solaris 10 February 26, 2008
Posted by invaleed in Solaris.2 comments
Sering sekali saya menemui kasus dimana seorang administrator lupa akan password root di salah satu mesin/server, mungkin dikarenakan banyaknya server/mesin yang mereka handle, walau sebenarnya hal ini tidak boleh terjadi
Nah dalam tulisan ini saya ingin mendokumentasikan howto tentang me-reset password root di mesin solaris 10
- Masuk ke OK prompt (bisa melalui halt, init 0 atau STOP + A)
- Booting ke cdrom dan masuk ke single user
- Check slice root dengan command “fsck”
- Mount slice root ke /mnt (atau /a)
- Masuk ke direktori /etc
- Untuk kemudahan penggunaan terminal ada baiknya kita export terminal terlebih dahulu
- Edit /etc/shadow (letak password root yang telah di enkrip)
- Hapus password root yg telah di enkrip (di kolom kedua)
- Masuk ke home directory root
- Umount mounting slice root yang tadi di mount ke /mnt
- Restart komputer (seharusnya nanti akan langsung masuk ke Solaris, tanpa ditanyakan password)
- Set ulang password root
ok> boot cdrom -s
# fsck -y /dev/rdsk/c0t0d0s0 (Letak slice root)
# mount /dev/dsk/c0t0d0s0 /mnt
# cd /mnt/etc
TERM=sun
export TERM
# vi shadow
….
root:(hapus):
….
# cd
# umount /mnt
# reboot
# passwd
Howto SUNWexplo Solaris 10 February 25, 2008
Posted by invaleed in Solaris.1 comment so far
Download paket SUNWexplo di website sun atau bisa juga diinstall dari DVD Solaris nya.
Extract file SUNWexplo.tar.Z:
# zcat SUNWexplo.tar.Z | tar xvf -
Install paket SUNWexplo:
# pkgadd -d . SUNWexplo
Jalankan SUNWexplo untuk meng-collect data-data mesin yang terinstall Solaris.
# /opt/SUNWexplo/bin/explorer
Output dari aplikasi ini di simpan dalam direktori /opt/SUNWexplo/output/explorer.XXXX dimana XXXX ini adalah angka-angka yang menidentifikasikan serial number mesin dan nama hostname.
ACL – Solaris 10 February 25, 2008
Posted by invaleed in Solaris.add a comment
Little documentation about ACL at Solaris 10
(-) The following example shows you how to substitute an ACL on the file named file1. The ACL permissions are configured as follows:
- The file owner has read, write, and execute permissions
- The group has read and write permissions
- The other users have read-only permissions
- The user named user1 has read, write, and execute permissions on the file
- The ACL mask has read and write permissions
- The user named user1 has read, write, and execute permissions
Perform the setfacl command with the following options to substitute an ACL on file1:
# setfacl -s u::rwx,g::rw-,o:r–,m:rw-,u:user1:rwx file1
Or using this command :
# setfacl -s u::7,g::6,o:4,m:6,u:user1:7 file1
(-) Command copies the ACL entries from the file named file1 to the file named file2
# getfacl file1 | setfacl -f – file2


