?
Solved

How to increase filesystems in Solaris 8

Posted on 2003-02-22
11
Medium Priority
?
634 Views
Last Modified: 2013-12-27
How do I modify partition 7 to be 10Gb instead of 25Gb and mount it as /home and then increase partition 6 to 16Gb without losing anything in /usr

Here is what my layout looks like:

Filesystem            Size  Used Avail Use% Mounted on
/dev/dsk/c0t2d0s0     236M   53M  160M  25% /
/dev/dsk/c0t2d0s6     4.0G  2.4G  1.6G  62% /usr
/dev/dsk/c0t2d0s5     4.0G   18M  3.9G   1% /var
swap                  2.4G   16K  2.4G   1% /var/run
/dev/dsk/c0t2d0s4     2.0G  2.1M  1.9G   1% /opt
swap                  2.4G   16K  2.4G   1% /tmp
/dev/dsk/c0t2d0s7      25G  9.0K   25G   1% /export/spare

partitions:

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -   125      251.02MB    (126/0/0)     514080
  1       swap    wu     126 -  1154        2.00GB    (1029/0/0)   4198320
  2     backup    wu       0 - 19155       37.27GB    (19156/0/0) 78156480
  3 unassigned    wu       0                0         (0/0/0)            0
  4 unassigned    wm    1155 -  2183        2.00GB    (1029/0/0)   4198320
  5        var    wm    2184 -  4240        4.00GB    (2057/0/0)   8392560
  6        usr    wm    4241 -  6297        4.00GB    (2057/0/0)   8392560
  7       home    wm    6298 - 19155       25.02GB    (12858/0/0) 52460640


Any help would be GREATLY appreciated.

Thanks
0
Comment
Question by:zeek_ja
[X]
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
11 Comments
 
LVL 5

Expert Comment

by:Nisus091197
ID: 8002631
Hi,

First and foremost, make a complete backup of all partitions on the disk, especially /usr using ufsdump.

Now, as you want to change /usr you are going to have to do it after booting from a different device, e.g. CD.

I am assuming that you are booting in single-user mode from CD.

As you are just rearranging the space between two adjacent partitions it's a relatively straightforward process.

Essentially the steps you need to perform are:

1. Backup /usr and /export/spare.  You could back them up to /var if you wanted as there is plenty of space there.

2. Boot in single-user mode from CD.

3. Run 'format' and resize partitions 6 and 7.

4. Label the disk within format.

5. Create new filesystems using newfs.

6. Restore /usr and /export/spare from backup using ufsrestore.

6. Edit /etc/vfstab to reflect new mount point for slice 7.

7. Disable automount from running (this messes with /home).

8. Reboot.

Do you need more details?

Regards, Nisus
http://www.omnimodo.com
0
 

Expert Comment

by:suneng
ID: 8003391
you can use Disksuite to configure the growfs to extended  any partition ,you can continus to extend to partition , but you need to backup the system everyday, because if the HDD is error , you can't mount the again , it may be cause the data loss.
0
 
LVL 4

Expert Comment

by:Otetelisanu
ID: 8006485
you can use ln  for big directory

0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 1

Expert Comment

by:SBK1972_uk
ID: 8015085
Hiya,

I would go with Nisus suggestion.

With growfs, I was under the impression that all devices have to be meta devices before you can grow them ? Is this right ?

Also, the `ln` command is a temp fix. A nasty temp fix infact. Using this method will introduce errors / issues with ufsdump and tar archive commands if not thought out properly. Certain archive commands need additional flags to either prevent or make them work over different ufs.

But, like everything in the world of administration, its time, money and whether you have all the orginal installation disks and necessary backups if all goes wrong :-)

SBK
0
 

Expert Comment

by:SqrFolkDnc
ID: 8017609
couple of nits.

I assume /export/spare is not in use.  You should back up everything, especially /usr, on general principle in case a finger check causes problems, but if nothing is really critical and backups would be difficult, it may not be worth it.

You can remove /export/spare from /etc/vfstab before starting, then you won't have to mess with automounter.

You can grow the filesystem in place with:
/usr/lib/fs/ufs/mkfs -F ufs -M [mount point] /dev/rdsk/c?t?d?s? [new size]
I think new size is # of blocks, which you can get from format or df.  I never did this except from volume manager, so my notes use vxprint to get the new size.  Try setting up a small filesystem somewhere before doing this on your live system.  You may need to have /usr unmounted when you do this, which would mean at least single user mode and maybe booting from CDROM.
0
 

Author Comment

by:zeek_ja
ID: 8027932
I think it necessary to elaborate...

true the /export/spare is not currently used and is 25Gb,
the /usr is 4Gb.

I do not have a backup system in place (i.e. tape drive or cd-burner) and i have yet to receive my installation media from Sun.

So i guess by the looks of things my options are limited. As for growfs... i don;t have any such tool on my system. Is this software downloadable from somewhere.. will it cost me anything?

The comment from SqrFolkDnc seems to be the most viable solution but having elaborated somewhat, i feel it's only fair to let you all respond again since ii may not have been clear from the start what my config was.

best regards...
0
 
LVL 5

Accepted Solution

by:
Nisus091197 earned 600 total points
ID: 8031876
Hi again,

The mkfs command is normally called by newfs and will not grow the filesystem.  It will create a new filesystem.

You can download the Solaris CDs from Sun's site for free.

There is plenty of room on /var to backup /usr so there should be no problems.

Use ufsdump to backup /usr to a file on /var

Veritas Volume Manager can grow filesystems but it cannot shrink them unless you are using the Veritas File System (VxFS).

If you bought both Veritas products you could achieve what you wish even while the system is running.

Be careful, Nisus
http://www.omnimodo.com
0
 

Assisted Solution

by:SqrFolkDnc
SqrFolkDnc earned 600 total points
ID: 8035245
Wait a second, why make things hard?

first, you have 29 gb in partitions 6 & 7, but you are only planning for 26 GB, do you intend to leave 3 gb unused?

If this is unclear post a question and I will elaborate.  This can all be done while booted from your normal system (don't need to boot from cdrom), but would probably be better to be in single user mode, or at least shut down as much as possible.  If any applications have log files in /usr, those files could end up in a state like they would be in if the system crashed hard.

Anyway,

method #1 (easier, but leaves /home as slice 6 and /usr as slice 7)
1. take /export/spare out of vfstab and unmount it.
2. go into format and change define a partition of 16 gb at the end of the physical disk.
3. from root directory, "touch reconfigure" and reboot.
4. do a newfs on the new partition 7
5. create a directory /newusr
6. then update vfstab to call partition 7 /newuser
7. mount /newuser
8. copy all files from /usr to /newusr (with preserve and doing all subdirectories
9. update vfstab to call partition 7 /usr and remove the old partition 6 reference.
10. reboot
11. go into format and change partition 6 to be 10 gb
12. touch reconfigure in root directory and reboot
13. newfs partition 6
14. create /home directory
15. update vfstab to make partition 6 /home and 10 gb
16. mount /home

method 2 synopsis only
1. similar, but define /newusr as 4 gb at the end of the disk, and move everything in /usr to it. (simnilar to steps 1-10 above)
2. once partition 7 is /usr at the end of the disk, define a a /newerusr in the old location, but for 16 gb and move everything from /usr to it. (similar to steps 1-10 above, again)
3. once /newerusr has been restored to being called /usr, you can create /home at the end of the physical disk, leaving 3 gb free after /usr and before /home.  (similar to steps 11-16)
4. This would allow later growing /usr to 19 gb as I suggested in my prior append.
0
 

Expert Comment

by:SqrFolkDnc
ID: 8035339
Hi zeek.  If you have Sun support for the machine, you can ask them for the format of the special mkfs command.  Don't take "can't do it" for an answer, they gave me that information in the first place (growing a filesystem in place).  They may try to tell you you need veritos volume manager (big $$), but you DO NOT.  I have done it.

Hi Nisus.

The alternate mkfs I pointed to in my previous append WILL grow a filesystem without erasing what is there.  I got that directly from level 2 suport at Sun, when I had to grow some filesystems on a production machine where I worked.  I was migrating a storage array from 4 gb disks to 19 gb disks, swapping a few disks at a time, mirroring to the new larger disks, breaking the mirror to the old disk, then growing the filesystem on the new disk.  That was all in disk suite, so my notes on the command use the number from a disk suite query command, but I do remember it was available from some option of df or from format also, maybe needing some kind of calculation.

I had to push hard to get Sun to tell me about the secret version of mkfs and its special option.

Hmmm, let me think.  Maybe the number is the starting block, i.e. 1 bigger than the last block already formatted.  I will have to play with that when I get my personal system set up.

But anyway, my second append, just above, eliminates the need for the special mkfs command until he wants to grow the /usr again and doesn't have space to do multiple moves.
0
 
LVL 18

Expert Comment

by:liddler
ID: 10425911

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Points split Nisus &  SqrFolkDnc

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

771 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