LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to mount iso file in /etc/fstab ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-mount-iso-file-in-etc-fstab-911610/)

gardenair 11-03-2011 05:26 AM

How to mount iso file in /etc/fstab ?
 
hi,
I have created an ios file.The file is located in root home directory. To mount the iso file manually i always manually mount it but when i restart the system i lost my mount.

# mount -o loop centos1.iso /mnt/iso/

I want to add it in my fstab .Kindly guide me that how can I do it?

I try myself but it does not mount

# vi /etc/fstab

LABEL=/home /home ext3 defaults 0 0

centos.iso /mnt/iso iso9660 loop,ro,auto 0 0

kindly help me
regards
mypass

Dušan Kreheľ 11-03-2011 05:33 AM

In my distribution (Slacware) was this okey:
Quote:

full_path_to_file /mnt/iso auto loop 0 0
full_path_to_file example: /home/dusan/install_iso/slackware-13.1-install-dvd.iso

ro,auto - this must you no write. iso9660 is always read only. iso9660 is read only file system. All disk are automont in boot system mounting.

Have fun.

gardenair 11-03-2011 06:10 AM

with your help i have lost the control of my system.The system go to run level 5 & then restart due to wronge entry in fstab. Now a new issue start that how can I edit my fstab file to remove the entry which u guide me.

When the system start i see a counter ,i hit it it say

'e' to edit command before booting,'a' to modify the kernel argument before booting or 'c' for a command-line.


please some one else help me

Dušan Kreheľ 11-03-2011 06:28 AM

What you write to a file?

hen770 11-03-2011 06:30 AM

Press 'e' at the menu and add the number 1 at the end of the line that start with 'kernel' or 'linux', then press enter and 'b', now you should boot to a cli env and change back your fstab file.
Better yet is to choice the recovery mode at the menu, hence you don't need to add the 1 number to the kernel arguments.

deep27ak 11-03-2011 06:33 AM

Quote:

Originally Posted by gardenair (Post 4514683)
hi,
I have created an ios file.The file is located in root home directory. To mount the iso file manually i always manually mount it but when i restart the system i lost my mount.

# mount -o loop centos1.iso /mnt/iso/

I want to add it in my fstab .Kindly guide me that how can I do it?

I try myself but it does not mount

# vi /etc/fstab

LABEL=/home /home ext3 defaults 0 0

centos.iso /mnt/iso iso9660 loop,ro,auto 0 0

kindly help me
regards
mypass


Code:

#vi /etc/fstab
/path/to/file              /mount/point/  file/type/  /permissions/or/options    dump-freq  pass-num
/dev/cdrom/filename.iso    /mnt/iso/      ext3          defaults                    0          0


gardenair 11-03-2011 06:36 AM

The iso file was in the root user home directory & i write

/ /mnt/iso loop 0 0

though i enter into single user mode by using a 1.I open the /etc/fstab file but it is read only.I want to delete the line which i add it but this will be possible if the file /etc/fstab is read & write.
Thought i have sh-3.2# prompt but unable to change the file as read only
kindly guide me how can i fix it

deep27ak 11-03-2011 06:36 AM

Quote:

Originally Posted by gardenair (Post 4514704)
with your help i have lost the control of my system.The system go to run level 5 & then restart due to wronge entry in fstab. Now a new issue start that how can I edit my fstab file to remove the entry which u guide me.

When the system start i see a counter ,i hit it it say

'e' to edit command before booting,'a' to modify the kernel argument before booting or 'c' for a command-line.


please some one else help me


and next time when you make experimental changes in fstab
don't restart to check

try this

Code:

#mount -a
this will update your fstab file

#mount
to check mount points

Now boot into your single user mode and try editing your fstab file again

deep27ak 11-03-2011 06:37 AM

Quote:

Originally Posted by gardenair (Post 4514717)
The iso file was in the root user home directory & i write

/ /mnt/iso loop 0 0

though i enter into single user mode by using a 1.I open the /etc/fstab file but it is read only.I want to delete the line which i add it but this will be possible if the file /etc/fstab is read & write.

kindly guide me how can i fix it

post the output of
Code:

#df -h

#fdisk -l

to check whether you are in root environment or not

gardenair 11-03-2011 06:58 AM

1 Attachment(s)
please see the out put in the file attach here with.

deep27ak 11-03-2011 07:05 AM

Quote:

Originally Posted by gardenair (Post 4514728)
please see the out put in the file attach here with.

everything looks fine


and as per your current problem
you are unable to make changes in your fstab file?

you can try this

Code:

#cp /etc/fstab  /fstab.orig

#vi /fstab.orig
(edit the line)

#mv /fstab.orig  /etc/fstab

But I don't think there should be any problem in editing fstab file in Single user mode

gardenair 11-03-2011 07:13 AM

yes u r correc,i am unable to make changes in your fstab file.
when i use the command which u mention ,it show

Code:

#cp /etc/fstab  /fstab.orig
cp:canot create regular file '/fstab.orig':Read only file system

My fstab file is currently read only that is the reason i can not make changes in it

thanks for your help,
gardenair

deep27ak 11-03-2011 07:22 AM

Quote:

Originally Posted by gardenair (Post 4514739)
yes u r correc,i am unable to make changes in your fstab file.
when i use the command which u mention ,it show

Code:

#cp /etc/fstab  /fstab.orig
cp:canot create regular file '/fstab.orig':Read only file system

My fstab file is currently read only that is the reason i can not make changes in it

thanks for your help,
gardenair

okie so I am sure you must be unable to change permission as well,

try this
Code:

#mount / -o remount,rw
or
Code:

#mount / -o -n remount,rw
#mount -n -o remount /

sorry I don't remember the exact syntax for second one..just trying to help

gardenair 11-03-2011 07:26 AM

This command work

# mount –n –o remount dev/sda2

I change my fstab file.I solve the new problem instead to solve my issue which i post in start of the thread.

thanks deep27ak for helping me to edit fstab file.

deep27ak 11-03-2011 08:09 AM

Quote:

Originally Posted by gardenair (Post 4514750)
This command work

# mount –n –o remount dev/sda2

I change my fstab file.I solve the new problem instead to solve my issue which i post in start of the thread.

thanks deep27ak for helping me to edit fstab file.

can you share something for other users facing this probleem
is your / partition in sda2?

and next time as I said don't take a risk on rebooting the system
use

Code:

#mount -a
and if your problem is solved mark the thread as solved


All times are GMT -5. The time now is 02:42 PM.