Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2009-04-03
Medium Priority
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 2000 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.
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.


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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
Teach the user how to convert virtaul disk file formats and how to rename virtual machine files on datastores. Open vSphere Web Client: Review VM disk settings: Migrate VM to new datastore with a thick provisioned (lazy zeroed) disk format: Rename a…
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…

722 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