How do I add a new disk to Solaris under VMware?

Posted on 2009-04-03
Last Modified: 2013-12-27
I am *very* new to Solaris so please be gentle...

I configured my Solaris VM to have an additional hard disk so this should be the same as adding a physical disk to a Solaris machine.  Now, how do I use this disk?  Specifically I would like to move /usr on to it as the disk analyzer reports that it is using most of the space on this system.

I guess I need to format it and then somehow move /usr on to it.  How can I do these things?


Question by:KhaiPi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 22

Accepted Solution

blu earned 500 total points
ID: 24059230
I think you might find it simpler just to start over, setting the main disk to the total size of both disks together. That will be much easier than trying to move things around.

I imagine that it is pretty much the same as it would be under a regular Solaris. You said that you already added the disk in VMware, so it should be visible to the OS. Run the "format" command to get a list
of disks that the OS sees. One will already be your currently installed disk.  The will show you the
device name (something like c1t0d1, like that). Write down the device that you want to add.  If you want
to use this disk in its entirety, then you will specify slice 2, otherwise you will need to use the
format command to partition the disk the way you want it, into smaller slices.

Once you get it partitioned the way you want, you need to create a file system on the slices. You can
use the mkfs command for that. You then mount the slice on /mnt using the mount command, and
copy the files over. You best bet is probably to use ufsdump and ufsrestore. Once you have done that,
you will need to reboot into single user, mv the existing /usr file to a new name and mkdir a new
/usr and add the slice to /etc/vfstab. At that point you should be able to reboot.

I suggest that you backup the original disk image befor you start this, because it will be easier to
recover if you have trouble. Are you sure you don't want to start over with a single disk?



Author Comment

ID: 24062602
I can't go back and start again as this is the same machine as the one with the now infamous problem trying to register (that you so bravely have been trying to resolve) and as things there are almost working I don't want to jeopardise that.  Unless there is a way to extend the size of the existing disk without having to reinstall Solaris?
Anyway, I have managed to add a new disk in to Solaris and the table now looks like this:
# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0d0s0      4856422 4709039   98819    98%    /
/devices                   0       0       0     0%    /devices
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                  765108     880  764228     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
                     4856422 4709039   98819    98%    /lib/
fd                         0       0       0     0%    /dev/fd
swap                  764304      76  764228     1%    /tmp
swap                  764264      36  764228     1%    /var/run
/dev/dsk/c0d0s7      2859343    2873 2799284     1%    /export/home
/hgfs                16777215    4096 16772864     1%    /hgfs
/tmp/VMwareDnD             0       0       0     0%    /var/run/vmblock
/dev/dsk/c0d1s0      8244981    8193 8154339     1%    /disk2

I notice that I have space on /dev/dsk/c0d0s7 so perhaps it would be easier to somehow give / access to that additional space?  All I am trying to do is to extend the / file system which is 98% full.
LVL 22

Expert Comment

ID: 24065524
Unfortuntely, there is no way to add space to a UFS file system.
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.


Author Comment

ID: 24065555
OK, thanks for the info.  Looks like I'll have to do it the hard way then.
Just to clarify the steps you outlined:
1. You then mount the slice on /mnt using the mount command, and copy the files over.
I have mounted the new disk on /disk2 (temporarily).  Is that OK?  And then copy which files to where exactly?
2. You will need to reboot into single user, mv the existing /usr file to a new name and mkdir a new /usr and add the slice to /etc/vfstab
How do I reboot into single user mode?
Thanks again Brian,
LVL 22

Expert Comment

ID: 24065612
Check the reboot command man page. I am not in front of my system right now, but I think it would be
something like "reboot -- -s"

Also take a look at the init man page.

You need to make an exact copy of all the files under /usr and restore them to /disk2. The best choice in this
case is probably the cpio command. Again, check the man page.

Author Closing Comment

ID: 31566205
Thanks Brian, in the end I took your advice and started over again.  I did try to get it to work but I just couldn't figure out the exact mount commands and vfstab settings.  Anyway,  I now have all the space I need.

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question