Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create filesystem in Solaris 9

Status
Not open for further replies.

m2001331

Technical User
May 29, 2002
73
0
0
MY
hello,
i am solaris newbie and i am required to create 3 filesystems with the size of 3GB,5GB and 1GB respectively.
i attempted to use the mkfs command but i have been very unsuccessful.after using smit in aix all this while,i find the transfer from aix to solaris very difficult.
i attempted to run the quot -a command and i got the following output:-
# quot -a
/dev/rdsk/c0t0d0s0 (/):
1225563 root
813 uucp
501 bin
69 adm
13 lp
4 daemon
4 nobody
2 smmsp
/dev/rdsk/c0t0d0s7 (/export/home):
9 root
1 oracle
this indicates that i have the second raw disk to create the filesystems.i have 2 18GB disks locally.
i need to create 3filesystems owned by 3 different users.I have created the users.however i have problems creating the filesystems.can anyone please help.i am rather confused with the solaris method of filesystem creation and management.
thanks in advance.
 
I have this output when i issue df -tk :-
# df -tk
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 1985043 1226969 698523 64% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
swap 11618000 104 11617896 1% /var/run
swap 11618208 312 11617896 1% /tmp
/dev/dsk/c0t0d0s7 7330893 10 7257575 1% /export/home
#
thanks
 
First you need to create partitions on the second disk using format. Note that slice 2 is usually reserved to cover the whole disk for historical reasons.

Once you have done that you can use the newfs command to create UFS filesystems.

Once you have created and mounted the filesystems (using the mount command) you can change their ownership to those users using the chown command.

You will also need to add the new filesystems to /etc/fstab to ensure they are mounted on the next boot. You can do this using a standard editor such as vi.

Have a look at the man pages for all of these commands for details.

Annihilannic.
 
By the information you have given, you have something around an 18 GB hard drive...

c0t0d0s0 - 2 GB Partition
c0t0d0s7 - 7 GB Partition
Swap - 11 GB

If you need the 11 GB swap, you do not have enough room on your Hard Drive for the new file systems. Do you need that much swap space???

If not, I will go through the steps with you to repartition your hard drive and set up your new file systems.
 
bfitzmai, he said that he has two 18GB disks, so it appears the second one, probably c0t1d0, is unused.

I agree with you though, it sounds like a hell of a lot of swap!

Annihilannic.
 
Missed the 2 18 GB disk available...

If you just installed the 2nd disk, you will need to do a reconfiguration boot so the OS sees the 2nd disk. As root, enter the following commands:

cd /
touch reconfigure

You will need to reboot the workstation, enter command: init 6

Once the workstation is back up, log in as root and enter the format command. You should see 2 disks listed. Your new 18 GB disk is disk 1. Enter 1... Since this is a new disk, you may see a warning message stating the disk is not labled and asking do you want to label the disk now... Answer Yes...

The next step is to partition your disk... Take a look the following web page to get an idea of how to partition a disk using the "All Free Hog" option... Start with Step 3.


At step 11, you will make entries something like:

Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 3000mb
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: 5000mb
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]: 1000mb
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]: 0
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]: 0
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]: 0

Your new partition map will be displayed... Notice the remainder of the disk (Around 9 GB) is in the "All Free Hog" partition...

Complete steps 13 - 18 (Step 17 is not really necessary) from the web page and your new 18 GB Disk is partitioned.

Next step is to create file system on your new disk. As root, enter the following commands:

newfs /dev/rdsk/c0t1d0s0
newfs /dev/rdsk/c0t1d0s1
newfs /dev/rdsk/c0t1d0s3

As a sanity check, I always run a file system check on the new file systems... This is not necessary...

fsck /dev/rdsk/c0t1d0s0
fsck /dev/rdsk/c0t1d0s1
fsck /dev/rdsk/c0t1d0s3

The next step is to mount the new partitions. You need to create mount points... You can put these mount points just about anywhere, my example will put them in your /export/home partition. You can name these mount point anything you want. Enter the following commands:

cd /export/home
mkdir user1
mkdir user2
mkdir user3

mount /dev/dsk/c0t1d0s0 /export/home/user1
mount /dev/dsk/c0t1d0s1 /export/home/user2
mount /dev/dsk/c0t1d0s3 /export/home/user3

Once you verify there are no problems mounting these 3 partitions, unmount the 3 partitions using the following commands:

umount /dev/dsk/c0t1d0s0
umount /dev/dsk/c0t1d0s1
umount /dev/dsk/c0t1d0s3

The next step is to allow the OS to automatically mount the new partitions when the workstation is booted up. You will be making entries in the file /etc/vfstab... There is one thing to always remember about this file... Each line in the /etc/vfstab file MUST have 7 entries... Each entry can be separated by a space or tab. Here is an example of your basic entries you would need to make...

/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 /export/home/user1 ufs 2 yes -
/dev/dsk/c0t1d0s1 /dev/rdsk/c0t1d0s1 /export/home/user1 ufs 2 yes -
/dev/dsk/c0t1d0s3 /dev/rdsk/c0t1d0s3 /export/home/user1 ufs 2 yes -

Once your entries are complete, test the entries using command: mountall

You will see some warnings stating that devices are already mounted... We know that. If you see there are no warnings about the new entries in the vfstab file, you should be good to go...

I hope I didn't miss anything... If you have any questions, let us know.

Bruce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top