Find the answer to your Linux question:
Results 1 to 6 of 6
We are using RHEL 5.7. When OS was installed the /opt partition was not created. Now we need to create /opt. I have used fdisk to create a linux partition ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2012
    Posts
    16

    How to mount partition?


    We are using RHEL 5.7. When OS was installed the /opt partition was not created. Now we need to create /opt.
    I have used fdisk to create a linux partition (/dev/sda11) but do not know how to mount it (add to fstab).


    In the absense of /opt, I did the following but I want to undo this
    Code:
    [rootATlab2]# cd /
    [rootATlab2]# mkdir opt
    [rootATlab2]# ln -s /home/excelsw/dialogic /opt

    Following is the layout:
    Code:
    [rootATlab2]# fdisk /dev/sda -l
    
    Disk /dev/sda: 160.0 GB, 160000000000 bytes
    255 heads, 63 sectors/track, 19452 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1           5       40131   de  Dell Utility
    /dev/sda2   *           6        6169    49512330   83  Linux
    /dev/sda3            6170        6245      610470   83  Linux
    /dev/sda4            6246       19452   106085227+   5  Extended
    /dev/sda5            6246        7010     6144831   83  Linux
    /dev/sda6            7011        7520     4096543+  83  Linux
    /dev/sda7            7521        8030     4096543+  83  Linux
    /dev/sda8            8031       13129    40957686   83  Linux
    /dev/sda9           13130       18228    40957686   83  Linux
    /dev/sda10          18229       18241      104391   82  Linux swap / Solaris
    /dev/sda11          18242       18366     1004031   83  Linux

    I have tried the following:

    Code:
    [rootATlab2]# mount /dev/sda11 /opt
           mount: you must specify the filesystem type
    [rootATlab2]# mount -t ext2 /dev/sda11 /opt
           mount: wrong fs type, bad option, bad superblock on /dev/sda11,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so
    
    [rootATlab2]# mount -t ext3 /dev/sda11 /opt
           mount: wrong fs type, bad option, bad superblock on /dev/sda11,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail  or so
    
    [rootATlab2]#
    [rootATlab2]#
    [rootATlab2]# dmesg | tail
          hfs: unable to find HFS+ superblock
          VFS: Can't find ext3 filesystem on dev sda11.
          VFS: Can't find ext3 filesystem on dev sda11.
          VFS: Can't find an ext2 filesystem on dev sda11.
          VFS: Can't find an ext2 filesystem on dev sda11.
          hfs: unable to find HFS+ superblock
          VFS: Can't find ext3 filesystem on dev sda11.
          hfs: unable to find HFS+ superblock
          VFS: Can't find an ext2 filesystem on dev sda11.
         VFS: Can't find ext3 filesystem on dev sda11.
    [rootATlab2]#

  2. #2
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    I don't know what you mean by "/opt partition was not created". It's a folder not a partition.
    But if you want to mount /dev/sda11 on /opt first you need to create filesystem on that partition. Use either console mkfs or something like gparted/parted. And then mount it.

    And to put it in /etc/fstab just copy and edit another line from that file and change it to something like
    Code:
    /dev/sda11 fs_type /opt defaults 0 0
    Put valid fs type there (prolly could be 'auto')

  3. #3
    Just Joined!
    Join Date
    Mar 2012
    Posts
    16
    I did the following:

    Code:
    [rootATlab2]# mkfs -t ext3 /dev/sda11
    [rootATlab2]# mount -t ext3 /dev/sda /opt11
    Then I edited the fstab file as:

    Code:
    LABEL= /		/		              ext3		defaults		1  1
    LABEL= /tmp		/tmp		ext3		defaults		1  2
    LABEL= /var		/var		ext3		defaults		1  2
    LABEL= /usr		/usr		ext3		defaults		1  2
    LABEL= /opt		/opt		ext3		defaults		1  2
    LABEL= /home		/home		ext3		defaults		1  2
    LABEL= /boot		/boot		ext3		defaults		1  2
    
    tempfs			/dev/shm	tempfs		              defaults		0  0
    devpts			/dev/pts	              devpts		gid=5,mode=620	0  0
    sysfs			/sys		sysfs		defaults		0  0
    proc			/proc		proc		defaults		0  0
    LABEL=SWAP-sda10	swap		swap		defaults		0  0
    Now Iam getting the following message at boot:

    Code:
    Under checking filesystems
    
    fsck.ext3: unable to resolve LABEL=/opt
    [FAILED]
    
    An error occured during the filesystem check
    ***Dropping you to a shell; system shall reboot when you leave the shell
    Give root password for maintenance or type Control-D to continue:
    I entered the root password and I got the following:

    Code:
    bash: /usr/bin/id : no such file or directory.
    bash: [: =: unary operator expected.
    bash: /usr/bin/id : no such file or directory.
    bash: [: =: unary operator expected.
    bash: /usr/bin/pkg-config : no such file or directory.
    (Repair Filesystem) 1 #
    I tried to goto fstab and remove the line (/opt) I added, but it is saying that fstab is readonly.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Mar 2012
    Posts
    16
    Never mind. I found the solution. At the filesystem repair prompt I ran the following command and it got fixed.

    Code:
    (Repair Filesystem) 1 # e2label /dev/sda11 /opt

  6. #5
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    In that console try
    Code:
    ~ e2label /dev/sda11 /opt
    or
    Code:
    ~ tune2fs -L "/opt" /dev/sda1
    and restart

    or boot another system (you have any livecd laying around?) and change contents of /etc/fstab to
    Code:
    ...
    /dev/sda11		/opt		ext3		defaults		1  2
    ...
    EDIT
    wrote that too late it seems glad to help anyway

  7. #6
    Just Joined!
    Join Date
    Mar 2012
    Posts
    16
    I appreciate your help.

    Quote Originally Posted by mitofik View Post
    In that console try
    Code:
    ~ e2label /dev/sda11 /opt
    or
    Code:
    ~ tune2fs -L "/opt" /dev/sda1
    and restart

    or boot another system (you have any livecd laying around?) and change contents of /etc/fstab to
    Code:
    ...
    /dev/sda11		/opt		ext3		defaults		1  2
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •