Mounting NTFS on Solaris 11

There are many blog entries and forum posts out there that talk about how to mount an NTFS partition or external drive on Solaris, but pretty much all of them are either outdated or have broken links.  I needed to mount my Western Digital My Passport on my Solaris 11 NAS, but NTFS wasn’t there.  So what I am posting here isn’t new, but just a summary of what I found that is still available today.  So far I have found two tools, not new, but located their current home.

mount-ntfs

mount-ntfs is a single binary solution.  You can download it from SourceForge at http://sourceforge.net/projects/mount-ntfs/ .  It’s a simple binary that you can run as such.

mount_ntfs /dev/rdsk/c15t0d0p0 /mnt/pp

FSWpart and FSWfsmisc

FSWpart and FSWfsmisc are Solaris packages that add NTFS as a valid filesystem to the standard mount utilities.  You can download these packages from ftp://ftp.sun.drydog.com/pub/solaris/.
Uncompress and install the packages with ‘root’ privileges.

% gunzip -c FSWpart.tar.gz | tar xvf -
# pkgadd -d . FSWpart

% gunzip -c FSWfsmisc.tar.gz | tar xvf -
# pkgadd -d . FSWfsmisc

Now you can mount just like any other partition.

mount -F ntfs /dev/rdsk/c15t0d0p0 /mnt/pp/

The one thing to note that is different about these tools compared to the standard mount tools, is that they run as a process.  Once you mount your partition, it will tell you that you need to kill the process to unmount the partition.  Using umount won’t work.

Enjoy.

This post ‘Mounting NTFS on Solaris 11’ first appeared on https://techandtrains.com/.

 

 

Headless VirtualBox as Server VMs on Solaris x86 Host

I use VirtualBox a lot on both my desktop and to run a few server type VMs like an email collection server, Minecraft server for the kids and a few others. The one issue I had with running VirtualBox on the server is that it wasn’t REALLY intended to be a server virtualization platform. But I liked using VirtualBox since I can easily move VM around. So I started a quest to find out a way to have VirtualBox automatically start VMs on my Solaris x86 NAS PC.  As I mentioned in an earlier post, I use Solaris x86 as my server/nas OS purely because of the outstanding ZFS.

I came across a great tool at http://sourceforge.net/projects/vboxsvc/ that provided just what I needed. It also does way more than I’ll use at home.

The following steps assume that you already created your VMs using VirtualBox.  These steps will just add it to the vboxsvc program.

Install VirtualBox SMF service (run as root)
root@nas# gzcat COSvboxsvc-0.16.pkg.gz > /tmp/x
root@nas# pkgadd -d /tmp/x -G

Create a smf XML file for your VM (run as local user).
admin@nas$ cp /var/svc/manifest/site/vbox-svc.xml ~/vbox-mail-svc.xml

Edit your new file and change the 3 parameters to match your installation and your VM name.  Find this section,
        <instance name='VM_NAME' enabled='false'>
                <method_context working_directory='/var/tmp'>
                        <method_credential user='root' group='root' />
                </method_context>

and change it to look something like this.  For me, the VM in VB is called ‘mail’, with VB running as my local user called ‘admin’, which is in the ‘vboxuser’ group.

        <instance name='mail' enabled='false'>
                <method_context working_directory='/var/tmp'>
                        <method_credential user='admin' group='vboxuser' />
                </method_context>

Import and start the VM (run as root)
root@nas# svccfg import vbox-mail-svc.xml
root@nas# svcs -a | grep -i xvm
disabled       Jan_04   svc:/site/xvm/vbox:mail
root@nas#
svcadm enable mail

root@nas# svcs -a | grep -i xvm
online         Jan_04   svc:/site/xvm/vbox:mail

Your VM should now be running.  If you have the VirtualBox Manager window open, you can see it starting in the preview window.

A few notes on how to use it.  I created a few aliases for each VM I add that will be  useful.  These alias are for the non-root user that the VMs are actually running as.  My aliases look something like the following for each VM I have.

alias showmail="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:mail startgui"
alias startmail="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:mail start"

‘showmail’ will ‘Save the machine state’ the VM and the automatically start it back up in a GUI so that you can interact with the console window.  When you are done with the console and want to send it back into headless mode, just click on the close window button and choose to ‘Save the machine state’.  Once the VM has been saved, vboxsvc will automatically start it back up in the headless mode.

‘startmail’ is just a simple alias that will start the VM in headless mode if the VM is not actually started yet.

So for each new VM you want to add to the vboxsvr, just copy the SMF file you created, change the name of the VM and import the SMF .  Then just create a few more aliases.

alias showminecraft="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:minecraft startgui"
alias startminecraft ="/lib/svc/method/vbox.sh -svc svc:/site/xvm/vbox:minecraft start"

There is a lot more create details at the website listed above.
This post ‘VirtualBox as Server VMs on Solaris x86 Host’ first appeared on https://gregorygee.wordpress.com/.

Replacing a disk in zfs mirror

Well, it paid off. Last week, I noticed that one of the disks in my NAS had failed. And of all the disks, it was the one with the family photos. So setting up the ZFS mirror saved my bacon. Below is what I saw.

 admin@nas:~# zpool status
  pool: files
 state: DEGRADED
status: One or more devices are unavailable in response to persistent errors.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or 'fmadm repaired', or replace the device
        with 'zpool replace'.
        Run 'zpool status -v' to see device specific details.
  scan: scrub repaired 0 in 14h27m with 0 errors on Tue Apr 16 15:27:09 2013
config:

        NAME        STATE     READ WRITE CKSUM
        files       DEGRADED     0     0     0
          mirror-0  DEGRADED     0     0     0
            c12d1   ONLINE       0     0     0
            c13d1   UNAVAIL      0     0     0

errors: No known data errors

As you can see, c13d1 had failed. If I really was fancy, I would have had a spare disk in the system and configured as the mirror spare and ZFS would have swapped out the bad drive for the spare automatically. But I didn`t go that route. So off to the store I went and got replacement.

Once I got the new drive, I shut down the system, replace the drive and booted back up. When I booted back up, the error message was still present as expected since the new disk had not ZFS content on it. All I had to do was issue the following command.

zpool replace files c13d1

From there, ZFS would resilver the new drive into the mirror. Depending on how big the drives were, it can take a while.


admin@nas:~# zpool status files
  pool: files
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function in a degraded state.
action: Wait for the resilver to complete.
        Run 'zpool status -v' to see device specific details.
  scan: resilver in progress since Sat May  4 22:25:34 2013
    4.92G scanned out of 1.50T at 18.2M/s, 23h54m to go
    2.41G resilvered, 0.32% done
config:

        NAME             STATE     READ WRITE CKSUM
        files            DEGRADED     0     0     0
          mirror-0       DEGRADED     0     0     0
            c12d1        ONLINE       0     0     0
            replacing-1  UNAVAIL      0     0     0
              c13d1/old  UNAVAIL      0     0     0
              c13d1      OFFLINE      0     0     0  (resilvering)
			  

And once it was done, the mirrot was back to normal.

admin@nas:~# zpool status files
  pool: files
 state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'. Once this is done, the
        pool will no longer be accessible on older software versions.
  scan: resilvered 1.49T in 9h56m with 0 errors on Mon May  6 09:49:31 2013
config:

        NAME        STATE     READ WRITE CKSUM
        files       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c12d1   ONLINE       0     0     0
            c13d1   ONLINE       0     0     0