• Add new hard disk on Solaris and share it by NFS & Samba

    by maxidea • 2010年06月18日 • UNIX\Linux • 0 Comments

    This is a note for myself and share my experience to my colleagues.

    In this case, we have two server running Sun Solaris 9 and Sun Solaris 10. We call it v250 and v245.

    Now we need to add one harddisk into v250 and share it to v245 by NFS. And it should be also be accessing by other MS windows workstation by SMB.

    The server name will be show on the following command before the # character.

    1) Input the new harddisk to the slot 7 on v250 server and startup machine.

    2) run command “/usr/sbin/devfsadm” & “/usr/sbin/devfsadm -C” to renew.

    3) run command “format” and the harddisk “2. c0t11d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>” was the one we just input.

    v250 # 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
    1. c0t9d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
    /pci@1d,700000/scsi@4/sd@9,0
    2. c0t11d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
    /pci@1d,700000/scsi@4/sd@b,0
    4) get the usr partition number by “partition” under FORMAT MENU, and the filesystem  /dev/dsk/c0t11d0s6 was the space we can use in this case.
    5) run newfs command to create a filesystem on /dev/rdsk
    v250 # /usr/sbin/newfs /dev/dsk/c0t11d0s6
    newfs: construct a new file system /dev/rdsk/c0t11d0s6: (y/n)? y
    /dev/rdsk/c0t11d0s6:    142820160 sectors in 14035 cylinders of 24 tracks, 424 sectors
    69736.4MB in 1404 cyl groups (10 c/g, 49.69MB/g, 6016 i/g)
    super-block backups (for fsck -F ufs -o b=#) at:
    32, 102224, 204416, 306608, 408800, 510992, 613184, 715376, 817568, 919760,
    Initializing cylinder groups:
    ………………………
    super-block backups for last 10 cylinder groups at:
    141861248, 141963440, 142065632, 142167824, 142270016, 142372208, 142474400,
    142576592, 142678784, 142780976,

    6) mount the harddisk on system

    v250 # cd /

    v250 # mkdir newharddisk

    v250 # vi /etc/vfstab

    Add a new line:

    /dev/dsk/c0t11d0s6       /dev/rdsk/c0t11d0s6      /newharddisk     ufs     7       yes     -

    v250 # mount -a

    7) share it by samba

    v250 # vi /etc/sfw/smb.conf

    Add new entry:

    newharddisk

    path = /newharddisk

    writable = yes

    create mode = 666

    directory mode = 777

    only user = no

    public = yes

    guest only = no

    # /etc/init.d/samba stop

    # /etc/init.d/samba start

    8 ) share it by NFS

    v250 #/usr/sbin/share -F nfs -o rw,anon=0 /newharddisk

    v250 # more /etc/dfs/sharetab

    /newharddisk      -       nfs     rw,anon=0

    v250 server configuration completed.

    9) Access newharddisk by NFS from v245

    v245#mkdir /newhardiskonv250

    v245# vi /etc/vfstab

    add a new line:

    v250:/newharddisk   –    /newhardiskonv250   nfs    yes   yes   bg

    v245# mount -a

    留下评论

    Your email address will not be published. Required fields are marked *