I am somewhat new to Solaris - and very new when it comes to mounts.
My problem is that when I installed Solaris, I allocated way too little diskspace to my / mount (it first became obvious now, however, because of new needs).
As you can see, I have lots of space allocated to /export/home.
My question is - can I (and how?) do I take 100 gb of space from /export/home and allocate to my / mount without literally screwing my system over?
The primary reason for this is that installing Oracle on my server requires at least 1,1-1,5 gb of available disk space on /. As you can see above, I only have 741 mb free disk space.
I hope you can point me in the right direction.
Please keep in mind that I never have played with mounts before on UNIX, so please be gentle
It can be done, but not exatly in the way you describe it.
Can you post a
du -sk /*
So we can see to what directories your space is allocated on the root disk. There are obvious directories such as /var and /usr that can be moved to new partitions, but we need to be sure you aren't using /opt or similar directories heavily.
That sounds interesting, Scott. Is there something in /usr/ that I should *not* move or can it all be moved safely to /export without corrupting any dependencies, links etc?
(I think you are absolutely right that it should be done from single user mode to be on the safe side).
Since the ls, mv etc reside in /usr/bin, I had to add a little extra to be able to create the link, remove the old /usr and move the usr-link to /. So far, so good and I was again able to do things without /export/... stuff in front.
However, after rebooting this prevents me from doing anything but going into system maintenance mode. The errors did not make much sense, so I decided to boot it into failsafe since Solaris itself suggested it because there was some diffs in /.
In failsafe, I realized I couldn't really do much (at least, not to my knowledge). In failsafe, I had an empty /usr. I rebooted again and attempted to start in normal mode. It fails and prompting that Console login is not possible and forced me again to enter system maintenance mode.
However, since system maintenance mode is read only, I am wondering - can you enter system maintenance in write mode? The only thing I need to do (as far as I can see) to bring things back in order is to -
1) Delete the usr link in /
2) Create new /usr dir
3) Move all data from /export/usr to /usr.
4) Reboot
My suggestion was to move as much from /usr as you needed to free up enough space to install Oracle.
cd /usr
mv openwin appserver /export
My statement that "Provided you create a link in /usr to the new location in /export there shouldn't be anything you can't move.", isn't strictly true (/usr/bin/init for example is a link to ../../sbin/init which would no longer be valid for /export/usr/bin since sbin is in / and ../../init would refer to a file in /export and not /), but I certainly didn't mean you to create a new usr directory under export and move everything from /usr into it, or rm -rf /usr.
But I really should have been clearer. Feeling responsible, I did a similar thing on my Solaris - which is now broken. (/export/usr is empty and /usr is no longer there), so I've had to reinstall it.
If your usr directory exists somewhere and you are able to remount / read-write then you should be able to fix this without re-installing.
Once my Solaris is finished installing, I'll have another look.
It's quite okay, no worries - after all, it's still a whole lot of learning and I would never store critical data on a Solaris server before I get more confident in doing stuff like this, so we're never literally screwed
However, I do have the complete contents of the usr directory. It's located now in /export/usr/. This means that if I can get write mode on the system maintenance, I will be able to restore the /usr directory.
Do you know what to do in order to be able to write stuff (move, create) while in maintenance mode?
When I attempt to do anything that would cause a read-operation on the disk, it says for example:
-bash-3.00# rm usr (attempting to delete usr link in /)
rm: usr not removed: Read-only file system
When i do a df -h to see what's on, we get (sorry for the horrible formatting, writting freehand since I can't SSH to the server atm :rolleyes:):
That's a relief I was quite worried that I aided and abetted you in breaking your system!
There is a remount option of the mount command which will mount it read-write, but I don't know if that works for /.
My Solaris is freshly installed, so I will try (once I get past all the "welcome", "did you know" and "configuring...." stuff that it throws up the first time you do anything on it.
I have been looking around in search for a "remount" but was unable to find one (attempted a find / -name remount too). Instead, I found mountall in /sbin/.
When I executed mountall, it mounted /tmp and /export/home. When I do a df -h, I now, besides my previous output have got these two:
This means that I can now write to /export/home/* but not to anything else. Unfortunately, this also means that I was unable to move /export/usr (and if I could, I would still not be able to create /usr and move the content to it) :rolleyes:
Strangely enough, my system does not recognize mount.
-bash-3.00# mount -o remount,rw /
-bash: mount: command not found
-bash-3.00# mount
-bash: mount: command not found
...Even though it is present in /sbin/ (I am in this dir when trying to execute):
-bash-3.00# ls -l | grep mount
-r-xr-xr-x 1 root bin 22992 Jan 23 2005 mount
-r-xr-xr-x 1 root sys 8159 Jan 22 2005 mountall
-r-xr-xr-x 1 root bin 18500 Oct 3 2008 umount
-r-xr-xr-x 1 root sys 7859 Jul 4 2007 umountall
I can only execute mountall and umountall - they share the fact that they are owned by root and belonging to the sys group. However, mount and umount are owned by root and belonging to the bin group. Does this mean anything or is it just "hot air"?
Actually I just thought the same thing, I fixed it with /etc/mount instead, but the result should be the same :rolleyes: I hit a few others bumps on the road.
I have mounted / with write and deleted the pesky usr-link, created /usr and moved /export/usr/* -> /usr.
It is still a bit wobbly, though. After a reboot, it says that it cannot find /usr/sbin/fsck.
Full message (muuuch shorter than before the "fix"):
WARNING - /usr/sbin/fsck not found. Most likely the mount of /usr failed or the /usr filesystem is badly damaged.
Jun 28 18:23:29 svc.startd[7]: svc:/system/filesystem/usr:default: Method "/libsvc/method/fs-usr" failed with exit status 95.
Jun 28 18:23:29 svc.startd[7]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run
Now, when I log in, it's clear that there is no such thing as /usr/sbin. I suppose this is less-than-good
Speculation: Could I boot into failsafe and create a /usr/sbin and copy /usr/xpg6/sbin to /usr/sbin? I tried from System Maintenance to create /usr/sbin and then a cp /sbin/* /usr/sbin which failed with:
cp: bpgetfile and /usr/sbin//bpgetfile are identical
cp: cannot access in.mpathd
Addition:
I found that bpgetfile is a link to /usr/sbin/pgetfile and in.mpathd is another link to /usr/lib/iet/in.mpathd. These *could* be discarded at first and investigated later?
I got a little further. Now, it complains that it cannot mount /dev/fd. I copied all files from /sbin -> /usr/sbin with the exception of the two links which were fairly broken.
Here's some ls-mayhem (I have not written owner, group and mods since i'm doing it manually this time):
-bash-3.00# ls -l /
Desktop
Documents
bin -> ./usr/bin
boot
core
dev
devices
etc
export
home
kernel
lib
lost+found
mnt
net
opt
platform
proc
rmdisk
sbin
system
tmp
u03
usr
var
vol
-bash-3.00# ls -l /export/usr
total 0
-bash-3.00# ls -l /usr
bin
sbin (I created the directory and copied /sbin/* -> /usr/sbin)
xpg6
Yeah, it could look like it's still missing something here and there.
Here is the result of our little detective work:
mount:
/ on /dev/dsk/c0d1s0 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1980000 on Sun Jun 28 18:45:26 2009
/devices on /devices read/write/setuid/devices/dev=4700000 on Sun Jun 28 18:45:26 2009
/system/contract on ctfs read/write/setuid/devices/dev=4740001 on Sun Jun 28 18:45:12 2009
/proc on proc read/write/setuid/devices/dev=4780000 on Sun Jun 28 18:45:12 2009
/etc/mnttab on mnttab read/write/setuid/devices/dev=47c0001 on Sun Jun 28 18:45:12 2009
/etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4800001 on Sun Jun 28 18:45:12 2009
/system/object on objfs read/write/setuid/devices/dev=4840001 on Sun Jun 28 18:45:12 2009
/etc/dfs/sharetab on sharefs read/write/setuid/devices/dev=4880001 on Sun Jun 28 18:45:12 2009