[Webinar] Streamline your web hosting managementRegister Today


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
  • 3
  • 3
LVL 22

Accepted Solution

Brian Utterback 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/libc.so.1
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

by:Brian Utterback
ID: 24065524
Unfortuntely, there is no way to add space to a UFS file system.
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.


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

by:Brian Utterback
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

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

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

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…
In this article will go through how to backup a vPostgres DB from a broken vCenter Appliance and restore to a new vCenter Appliance.
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
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…
Suggested Courses

591 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