AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
Expand all | Collapse all

Automatically mounting a filesystem after a reboot

  • 1.  Automatically mounting a filesystem after a reboot

    Posted Tue February 26, 2008 10:56 AM

    Originally posted by: SystemAdmin


    Hi All,

    I am new to AIX. I am having problems mounting a filesystem after a system reboot.

    Steps:

    1. Create and Map LUN to host

    2. On the host, to detect/configure the LUN: /usr/sbin/cfgmgr

    3. Create a filesystem: mkfs -V vxfs /dev/hdisk757

    4. Create a mountpoint: mkdir -p /mnt/testlun; chmod 777 /mnt/testlun

    5. Mount the filesystem: mount -V vxfs -o log=INLINE /dev/hdisk757 /mnt/testlun

    6. Populate the /etc/filesystems:
    echo '
    /mnt/testlun:
    dev = /dev/hdisk757
    vfs = vxfs
    log = INLINE
    mount = automatic <--- Tried using "true"
    check = false' >> /etc/filesystems

    7. touch a file

    8. ls /mnt/testlun
    testfile1

    9. reboot

    After the system reboots, I don't see the filesystem in the df output.

    Are the above steps correct?. Do I need to use some kind of container like volume group or diskgroup for veritas, before I can create a filesystem on it.??

    Any help would be appreciated..

    Thanks...
    #AIX-Forum


  • 2.  Re: Automatically mounting a filesystem after a reboot

    Posted Tue February 26, 2008 02:17 PM

    Originally posted by: hwyguy


    Hi,

    Yes you need to use a volume group before you can create a filesystem on AIX, and you shouldn't have to modify /etc/filesystems - AIX should do this for you.

    You're on the right track, you just missed a few steps.

    Here's a brief overview of the steps from Mapped LUN to mounted filesystem using SMIT which is generally a best place to start for AIX beginners.

    Note, for most SMIT menu's where it doesn't ask for a name (i.e. FS name, VG name, etc), hit F4 or ESC then 4 to bring up a list of options.

    1.) Map LUN to host
    2.) run cfgmgr so AIX sees the LUN.
    3.) Create a volume group for the LUN using the the command smitty mkvg
    4.) Choose Original Volume Group
    5.) Name the volume group, assign a Physical Partition Size (smaller is generally better if you ever intend on spreading the VG over many hdisks in the future), and specify which hdisk you want to join the new VG. Press Enter to create
    6.) Create a JFS2 filesystem using the command smitty crjfs2std
    7.) Choose the Volume Group you've just created
    8.) Enter the number of units, type of units (MB, GB, 512-bytes), mount point, use TAB or F4 to change the option "Mount AUTOMATICALLY at system restart?" to YES. Press Enter to create
    9.) Mount the filesystem: mount /newfilesystem
    10.) Enjoy!

    Note, this is a pretty simplistic way to create a FS.

    When you get some time, I highly recommend you read the following Redbook to get a better understanding of AIX and the Logical Volume Manager:

    http://www.redbooks.ibm.com/Redbooks.nsf/RedbookAbstracts/sg247199.html

    As always, feel free to post any questions on here.

    Good luck and Welcome to AIX!
    #AIX-Forum


  • 3.  Re: Automatically mounting a filesystem after a reboot

    Posted Wed February 27, 2008 11:45 AM

    Originally posted by: unixgrl


    Since it looks like you are using VXFS and not JFS2....

    instead of using "mkfs", use "crfs" which will automatically put the entry in /etc/filesystems and save you a step.
    Then make sure mount=true.

    After that, you just have to ensure your Veritas volume group automatically starts after a reboot. If its not auto-starting, your filesystem can't. I know on my tests, my Veritas disk groups have been auto-importing after a reboot without doing anything to them.
    #AIX-Forum