Create a fs

hello

sorry but i'm beginning with solaris (i use Aix)
How can I create a new filesystem with solaris 9 ? (and define the size ).
I find newfs and mkfs but i don't know how use it

Thank you

First, check out unixguide.net to get a feel from what you know (AIX) to Solaris.

To create a new filesystem, you would first check what is being used - and to know that, you may need to look into the following:

df -kl

If any of the filesystems have vx in the device name, then it's using Veritas Volume manager. If they have md in the device name, then it's using Solaris Volume Manager (SVM, also known as ODS and DiskSuite). You can also have hardware raid.

Examples of root partitions:
/dev/dsk/c0t0d0s0
SVM: /dev/md/dsk/d0
Veritas: /dev/vx/dsk/rootdg/d01

Let's just say you have a 'generic' set up - no hardware or software raid going on. You have a empty slice that you can use (let's say it's on /dev/rdsk/c0t0d0s5).

NOTE: The following is an example only - running these commands without knowing your set up may destroy a valid filesystem and crash your server.

You would go into the format utility as root.
# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
0. c0t0d0 <Seagate blah..blah...blah>
/pci@1f,0/pci@1,1/ide@3/dad@0,0
Spedify disk (enter its number): 0
selecting c0t0d0
[disk formatted, no defect list found-
Warning: Current Disk has mounted partitions.

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> p

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> p
Current partition table (original):
Total disk cylinders available: 8892 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 7212 3.25GB (7213/0/0) 6816285
1 swap wu 7213 - 8336 518.64MB (1124/0/0) 1062180
2 backup wm 0 - 8891 4.01GB (8892/0/0) 8402940
3 unassigned wm 8337 - 8836 256.09MB (500/0/0) 524475
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0

partition> 5
Part Tag Flag Cylinders Size Blocks
5 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:8837
Enter partition size[0b, 0c, 0.00mb, 0.00gb]:55c
partition> label
label disk? y
partition> q

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> q
# newfs /dev/rdsk/c0t0d0s05
newfs: construct a new file system /dev/rdsk/c0t0d0s5: (y/n)? y

After it's completed, you can mount the new filesystem to the directory that you require (as long as the mount point exist).
mount /dev/dsk/c0t0d0s5 /mynewfilesystem

Information on SVM can be found at SVM - docs.sun.com
Info on the different SVM products - list of versions / SVM products
Solaris version documentation
Disk administration

thank you very much for your detailled response :slight_smile: :slight_smile:

Hi buddy
Thank you very much for your reply
Hope this will help.

Regards
Roy