[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

solaris new partitions

Posted on 2006-04-13
6
Medium Priority
?
508 Views
Last Modified: 2013-12-27
I need to setup a second disk I have on a solaris 9 box for my apps and logs.
Ok, I thought I had this but guess I don't. Below is what my 2nd disk looks like now that I've played with it. what I want to do here is use:
#1 for more swap
#6 for apps
#7 for logs/archives and backups

doesn't seem right, how do I give it the names that I want, like /opt /backup /logs
do I do that after I run the newfs on each one, not sure here, never actuall created this and just not sure what the next steps are.

partition> print
Current partition table (original):
Total disk cylinders available: 7506 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)           0
  1 unassigned    wm    6677 - 7504        1.86GB    (828/0/0)   3901536
  2     backup    wm       0 - 7505       16.86GB    (7506/0/0) 35368272
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6 unassigned    wm       0 - 3560        8.00GB    (3561/0/0) 16779432
  7 unassigned    wm    3561 - 6676        7.00GB    (3116/0/0) 14682592
0
Comment
Question by:bt707
  • 3
  • 2
6 Comments
 
LVL 2

Assisted Solution

by:CadburyKat
CadburyKat earned 1600 total points
ID: 16449318
Hello,

This is how I would setup a disk through Solstice Volume manager (I run Solaris 10).  In this example I will use format to figure out which disk I am referencing.  Your results will be different.

localhost>format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1d,700000/scsi@4/sd@0,0

In this case I am referencing disk c0t0d0.  The slice in your example is s6 or s7 with some left over space in s1 for swap.  (You should not reference s2 here).

You then need to newfs the slice and mount it.

the commands you need are:

newfs /dev/dsk/c0t0d0s1
newfs /dev/dsk/c0t0d0s6
newfs /dev/dsk/c0t0d0s7

You then need to add these slices with entries in your /etc/vfstab

Here is an example:

/dev/dsk/c0t0d0s1  -       -       swap    -       no      -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /apps ufs 3 yes -
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /logs/archives ufs 3 yes -

Ensure that the mountpoints /apps and /logs/archives exist and then issue the command:

mount /apps
mount /logs/archives

verify success with command:

df -k

Enable the swap by issueing the command:

swap -a /dev/dsk/c0t0d0s1

verify additional swap with command:

swap -l


Good Luck.

p.s.  I would look into using Solstice Volume manager to mirror your disks.  Some commands of interest are metainit, metadb, and metastat.  They should be documented in the man pages.
0
 

Author Comment

by:bt707
ID: 16450486
I created a swap for #1 -- /opt for #6 -- and /backup for #7

the swap and /opt is working fine, however I'm getting a error when doing a mount on /backup

bash-2.05$ sudo mount /backup
mount: mount-point /backup does not exist

did the newfs, did not show any errors?


newfs /dev/dsk/c0t1d0s7
newfs: construct a new file system /dev/rdsk/c0t1d0s7: (y/n)? yes
/dev/rdsk/c0t1d0s7:     14682592 sectors in 3116 cylinders of 19 tracks, 248 sectors
        7169.2MB in 142 cyl groups (22 c/g, 50.62MB/g, 6208 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 103952, 207872, 311792, 415712, 519632, 623552, 727472, 831392, 935312,
 13684704, 13788624, 13892544, 13996464, 14100384, 14204304, 14308224,
 14412144, 14516064, 14619984,


/opt is showing up and is mounted


Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0    1985043  338290 1587202    18%    /
/dev/dsk/c0t0d0s3    3009327 1540553 1408588    53%    /usr
/proc                      0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
fd                         0       0       0     0%    /dev/fd
/dev/dsk/c0t0d0s4    4032142  138656 3853165     4%    /var
swap                 8216432      48 8216384     1%    /var/run
swap                 8216432      48 8216384     1%    /tmp
/dev/dsk/c0t0d0s5    3799710 1085865 2675848    29%    /home
/vol/dev/dsk/c0t6d0/sol_9_904_sparc/s5
                         114       4     100     4%    /cdrom/sol_9_904_sparc/s5
/vol/dev/dsk/c0t6d0/sol_9_904_sparc/s4
                         114       4     100     4%    /cdrom/sol_9_904_sparc/s4
/vol/dev/dsk/c0t6d0/sol_9_904_sparc/s3
                         114       4     100     4%    /cdrom/sol_9_904_sparc/s3
/vol/dev/dsk/c0t6d0/sol_9_904_sparc/s2
                         114       4     100     4%    /cdrom/sol_9_904_sparc/s2
/vol/dev/dsk/c0t6d0/sol_9_904_sparc/s1
                      555754  514128       0   100%    /cdrom/sol_9_904_sparc/s1
/vol/dev/dsk/c0t6d0/sol_9_904_sparc/s0
                     3481568 3481568       0   100%    /cdrom/sol_9_904_sparc/s0
/dev/dsk/c0t1d0s6    8261393    8217 8170563     1%    /opt


Current partition table (original):
Total disk cylinders available: 7506 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)           0
  1 unassigned    wm    6677 - 7504        1.86GB    (828/0/0)   3901536
  2     backup    wm       0 - 7505       16.86GB    (7506/0/0) 35368272
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6 unassigned    wm       0 - 3560        8.00GB    (3561/0/0) 16779432
  7 unassigned    wm    3561 - 6676        7.00GB    (3116/0/0) 14682592


swap shows up as ok

bash-2.05$ swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0t0d0s1   32,1      16 9216656 9216656
/dev/dsk/c0t1d0s1   32,9      16 3901520 3901520


This is what I have in the /etc/vfstab

#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c0t0d0s1       -       -       swap    -       no      -
/dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      -
/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /usr    ufs     1       no      -
/dev/dsk/c0t0d0s4       /dev/rdsk/c0t0d0s4      /var    ufs     1       no      -
/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /home   ufs     2       yes     -
swap    -       /tmp    tmpfs   -       yes     -
/dev/dsk/c0t1d0s1       -       -       swap    -       no      -
/dev/dsk/c0t1d0s6       /dev/rdsk/c0t1d0s6      /opt    ufs     3       yes     -
/dev/dsk/c0t1d0s7       /dev/rdsk/c0t1d0s7      /backup         ufs     3       yes     -


any ideas on the errors on /backup?

Thanks,

0
 
LVL 2

Expert Comment

by:CadburyKat
ID: 16450827
does the mount point /backup exist?  You can tell by issueing the following:

cd /
ls -al | grep backup

If it does not exist, you can make the mount point via:
mkdir /backup

If you did not make the previous mount point you mounted over data.  That is probably not what you wanted to do with respect to /opt

You may need to unmount /opt, tar it up, remove the data in /opt, remount it, and untar the existing data.  

0
Independent Software Vendors: 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!

 

Author Comment

by:bt707
ID: 16452521

CadburyKat, I think I had it all ok was just a bit confused about a few things, thanks for
the help, the info you gave me helped to understand more here.



One thing I still cannot get right or understand is now that I have /opt and /backup mounted on
the second Disk "c0t1d0*" what do I need to do for the /opt and /backup to show up when I go into
partion from format. I've tried to give the Tag a name but it just gives me errors saying what ever I
put in was not expected.

Disk one and two showing what I setup and is all ok.



Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s0      1.9G   330M   1.5G    18%    /
/dev/dsk/c0t0d0s3      2.9G   1.5G   1.3G    53%    /usr
/proc                    0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
fd                       0K     0K     0K     0%    /dev/fd
/dev/dsk/c0t0d0s4      3.8G   135M   3.7G     4%    /var
swap                   7.9G    40K   7.9G     1%    /var/run
swap                   7.9G    48K   7.9G     1%    /tmp
/dev/dsk/c0t0d0s5      3.6G   1.0G   2.6G    29%    /home
/dev/dsk/c0t1d0s7      6.9G   7.0M   6.8G     1%    /backup
/dev/dsk/c0t1d0s6      7.9G   8.0M   7.8G     1%    /opt


________________________________________________________________________

*******************************************************************

question here is how do I get the correct names in the Tag (i.e #1 swap #6 /opt #7 /backup)

*******************************************************************


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /pci@1f,4000/scsi@3/sd@0,0
       1. c0t1d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /pci@1f,4000/scsi@3/sd@1,0
Specify disk (enter its number): 1
selecting c0t1d0
[disk formatted]
Warning: Current Disk has mounted partitions.

partition> print
Current partition table (original):
Total disk cylinders available: 7506 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)           0
  1 unassigned    wm    6677 - 7504        1.86GB    (828/0/0)   3901536
  2     backup    wm       0 - 7505       16.86GB    (7506/0/0) 35368272
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6 unassigned    wm       0 - 3560        8.00GB    (3561/0/0) 16779432
  7 unassigned    wm    3561 - 6676        7.00GB    (3116/0/0) 14682592


Thanks,
0
 
LVL 7

Accepted Solution

by:
XoF earned 400 total points
ID: 16454323
you cannot see mountpoints in format-output. the tags you can assign within format are kind of historical nature and do not have any impact on where the slice actually will be mounted - mountpoints are only determined by /etc/vfstab. Leaving the tag "unassigned" isn't the worst choice at all.

Regards,
-XoF-
0
 

Author Comment

by:bt707
ID: 16460084
Thanks to both for the info, didn't really understand it like I thought I did but see it much better now.

Thanks again
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month19 days, 9 hours left to enroll

873 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