Solved

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

Posted on 2009-04-03
6
1,230 Views
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?

Thanks,

KP
0
Comment
Question by:KhaiPi
  • 3
  • 3
6 Comments
 
LVL 22

Accepted Solution

by:
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?

see:
http://blogs.sun.com/harcey/entry/solaris_x86_vmware_adding_a
http://argray.com/unixfaq/solaris_new_disk.shtml
http://unix.derkeiler.com/Mailing-Lists/SunManagers/2003-06/0118.html

0
 

Author Comment

by:KhaiPi
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
/usr/lib/libc/libc_hwcap1.so.1
                     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.
0
 
LVL 22

Expert Comment

by:blu
ID: 24065524
Unfortuntely, there is no way to add space to a UFS file system.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:KhaiPi
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,
-Qu0ll
0
 
LVL 22

Expert Comment

by:blu
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.
0
 

Author Closing Comment

by:KhaiPi
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…
Teach the user how to join ESXi hosts to Active Directory domains Open vSphere Client: Join ESXi host to AD domain: Verify ESXi computer account in AD: Configure permissions for domain user in ESXi: Test domain user login to ESXi host:

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now