LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-03-2011, 04:26 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
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
 
Old 11-03-2011, 04:33 AM   #2
Dušan Kreheľ
LQ Newbie
 
Registered: Oct 2011
Posts: 3
Blog Entries: 1

Rep: Reputation: Disabled
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.

Last edited by Dušan Kreheľ; 11-03-2011 at 04:35 AM.
 
Old 11-03-2011, 05:10 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
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
 
Old 11-03-2011, 05:28 AM   #4
Dušan Kreheľ
LQ Newbie
 
Registered: Oct 2011
Posts: 3
Blog Entries: 1

Rep: Reputation: Disabled
What you write to a file?
 
Old 11-03-2011, 05:30 AM   #5
hen770
Member
 
Registered: Oct 2010
Distribution: Arch
Posts: 136

Rep: Reputation: 7
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.
 
Old 11-03-2011, 05:33 AM   #6
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by gardenair View Post
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
 
Old 11-03-2011, 05:36 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
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

Last edited by gardenair; 11-03-2011 at 05:42 AM.
 
Old 11-03-2011, 05:36 AM   #8
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by gardenair View Post
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
 
Old 11-03-2011, 05:37 AM   #9
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by gardenair View Post
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
 
Old 11-03-2011, 05:58 AM   #10
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
please see the out put in the file attach here with.
Attached Thumbnails
Click image for larger version

Name:	file1.PNG
Views:	172
Size:	26.0 KB
ID:	8292  
 
Old 11-03-2011, 06:05 AM   #11
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by gardenair View Post
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
 
Old 11-03-2011, 06:13 AM   #12
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
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
 
Old 11-03-2011, 06:22 AM   #13
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by gardenair View Post
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

Last edited by deep27ak; 11-03-2011 at 06:24 AM.
 
Old 11-03-2011, 06:26 AM   #14
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
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.

Last edited by gardenair; 11-03-2011 at 06:43 AM.
 
Old 11-03-2011, 07:09 AM   #15
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by gardenair View Post
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

Last edited by deep27ak; 11-03-2011 at 07:21 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not accepting the encryped file in fstab to mount win.. share through cifs raju.muppana Linux - Networking 3 06-25-2010 10:58 AM
Mount NTFS partition deeper in file system with fstab? fhsm Linux - Newbie 2 03-15-2010 10:38 PM
changing /tmp mount on fstab file with noexc emymcse Linux - Newbie 1 12-16-2007 05:54 PM
mount .iso (image) file and read *.avi file smartdragonfly Linux - Software 2 12-21-2006 04:48 AM
Can't mount .iso file stormrider_may Linux - Software 6 04-22-2006 06:41 PM


All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration