May 30, 08 by cjgibbs
This blows my mind every time I read it.
ZFS has been designed from the ground up to be the most scalable file system, ever. The file system itself is 128-bit, allowing for 256 quadrillion zettabytes of storage. All metadata is allocated dynamically, so no need exists to pre-allocate inodes or otherwise limit the scalability of the file system when it is first created. All the algorithms have been written with scalability in mind. Directories can have up to 248 (256 trillion) entries, and no limit exists on the number of file systems or number of files that can be contained within a file system.
Source: ZFS Administration Guide
May 16, 08 by cjgibbs
My purpose for doing this was to automate file transfers between servers. So I needed a secure copy method (SCP) without prompting for a password (SSH keys). I’ll call my two systems production and backup. I need to be able to ssh from production to backup without it prompting for a password.
On production generate your private/public key pair:
chris@production ~$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/chris/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/chris/.ssh/id_dsa.
Your public key has been saved in /export/home/chris/.ssh/id_dsa.pub.
The key fingerprint is:
bd:cf:bb:c0:30:1c:c3:5f:74:80:3b:f0:1f:82:20:bb chris@production
Put the public key file (id_dsa.pub) on the remote system you will be ssh’ing to as the authorized_keys2 file in the .ssh directory of the user you will be using to ssh:
chris@production ~$ scp ~/.ssh/id_dsa.pub backup:.ssh/authorized_keys2
Or append it if you have a preexisting authorized_keys2 file.
That’s it. You should be able to ssh from production to backup with whatever password you entered in the key generation process (or none if you didn’t enter one).
April 11, 08 by cjgibbs
This morning while I’m still asleep my wife goes “Chris your computer is making a noise…” and after repeating herself ten times I finally comprehend what she’s saying and start listening. Sure enough there was a loud clicking noise coming from my server in the other room. I figured I had just lost a hard drive but I wasn’t worried because I have a spare that’s supposed to pop into action when this happens. So I hit the power button once and listen as it shuts itself down cleanly.
Looking back I probably should have been more cautious but hey, I was still 98% asleep. When I finally got a chance to look at it, I find out the spare wasn’t actually added to my storage pool. Oops, my bad. Well I still wasn’t worried because my storage pool (all my really important data) was still up and rockin’:
peemus@serenity ~ $ zpool status -v
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
c2d0 ONLINE 0 0 0
c2d1 ONLINE 0 0 0
c3d0 ONLINE 0 0 0
c3d1 ONLINE 0 0 0
c1t0d0 UNAVAIL 0 0 0 cannot open
c1t1d0 ONLINE 0 0 0
c1t2d0 ONLINE 0 0 0
c1t3d0 ONLINE 0 0 0
errors: No known data errors
So what did I do next? Added my spare and replaced my failed drive of course!
peemus@serenity ~ $ sudo zpool add tank spare c1t4d0s4
peemus@serenity ~ $ sudo zpool replace tank c1t0d0 c1t4d0s4
peemus@serenity ~ $ zpool status -v
pool: tank
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: resilver in progress, 0.05% done, 2h16m to go
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
c2d0 ONLINE 0 0 0
c2d1 ONLINE 0 0 0
c3d0 ONLINE 0 0 0
c3d1 ONLINE 0 0 0
spare DEGRADED 0 0 0
c1t0d0 UNAVAIL 0 0 0 cannot open
c1t4d0s4 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
c1t2d0 ONLINE 0 0 0
c1t3d0 ONLINE 0 0 0
spares
c1t4d0s4 INUSE currently in use
errors: No known data errors
Check that out! So to recap, it was my fault I didn’t have a spare configured, but ZFS let me add my spare and replace my failed drive with it - all while my data stayed up. You can even see it scrubbing data over to the spare!
ZFS rocks.
April 11, 07 by cjgibbs
Disable
# /usr/dt/bin/dtconfig -d
Enable
# /usr/dt/bin/dtconfig -e
April 03, 07 by cjgibbs
First map the .iso file to a device:
# lofiadm -a /path/to/image.iso /dev/lofi/1
Note: You can mount more images by incrementing the lofi device number (/dev/lofi/2).
Now just mount it like a file system:
# mount -o ro -F hsfs /dev/lofi/1 /mnt/image
The ISO file should now be mounted at /mnt/image
April 03, 07 by cjgibbs
Spent forever looking for this:
# /var/sadm/prod/entsys/SUNWentsys4/uninstall
March 15, 07 by cjgibbs
So I know there is ample documentation on this in the Sun docs but if you’ve ever tried to read Sun docs then you know that someone giving an example is much easier to understand. The goal will be to create a container in the fewest number of steps. This should work on any release of Solaris 10 but I will be using u3. Read the rest of this entry »
February 24, 07 by cjgibbs
In this scenario I am using a fresh install of Solaris 10 u3. There are two network interfaces configured: vfe0 is the “external” interface as it connects directly to the cable modem and gets it’s IP via DHCP; rtls0 is the “internal” interface as it connects to a local network switch along with other computers on the network. Use routeadm to enable IP Forwarding & IP Routing at the system level: Read the rest of this entry »