#### Archived

This topic is now archived and is closed to further replies.

# Mounting In Linux

This topic is 5838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Do I have to be in root to mount something on linux. I tried mounting my flopy /dev/fd0 but it wont take.

##### Share on other sites
Put a line something like this in /etc/fstab:/dev/fd0 /mnt/floppy auto noauto,user,rw,defaults 0 0. I think I did that correctly, but I didn''t check, so it may be a little off.

##### Share on other sites
Nope, that didnt work.

##### Share on other sites
How are you trying to mount the drive? And what does it say when you try to do it?

##### Share on other sites
It would help if you said why it didn''t work. A derivative of that certainly works for me for all of my hard drives and partitions. The part with "user" enables other users to mount and unmount the drive. The part with "/mnt/floppy" must be changed to where your floppy drive mounts. You must have a floppy drive in there obviously.

##### Share on other sites
Type ''man mount'' and it''ll give you an example of how to edit your /etc/fstab file to allow any users to mount drives. Let''s say you want your CD drive to mount to /cdrom. Once you correctly edit the fstab file, you''d say ''mount /cdrom'' to mount it.

##### Share on other sites
Ok, when I try and mount the path my CDROM is at this is what it says, mount /dev/hdc I could not determine the filesystem type, and none was specified. What should I do?

##### Share on other sites
Try to specify the file system (iso9660). Also, consider installing the ''man'' package, where you could see, in mount(8):

Thus, given a line
/dev/cdrom /cd iso9660 ro,user,noauto,unhide
any user can mount the iso9660 file system found on his
CDROM using the command
mount /dev/cdrom
or
mount /cd

I don''t want to sound harsh but I fail to understand how most of the topics here pertain to game development on unix.

Hope this helps anyway.

##### Share on other sites
I am sorry, I know I am takeing up space on the MB, but, how can I develop if I cant run the CDROM. This is where it is, /dev/hdc /mnt/cdrom auto user,iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0 Then I tried to mount it in my User acount, and it said I needed to be in root. So I went to root, and mounted it, but it still dosnt work.
Ounce again, I am sorry for takeing up space on the MB.

##### Share on other sites
quote:
So I went to root, and mounted it, but it still dosnt work.

What do you mean? You have got to be specific . Did it not mount? Did it give you an error message? If so, what was it?

##### Share on other sites
Wekkm sense I am not very sure what I am supposed to do, and it gave me a rather long messege after words, I will stop with this post. Sorry for waisting space.

##### Share on other sites
quote:
Wekkm sense I am not very sure what I am supposed to do, and it gave me a rather long messege after words, I will stop with this post. Sorry for waisting space.

Don''t quit posting because I was a bit harsh. The problem is that you''re not providing enough informations. In order to help you, it would be useful to know what kind of system you''re running, (uname -a), the commands you typed to mount the CD and the error messages.

For instance, I have multiple ideas of what could be wrong here, and without more precisions, it''s hard to tell. It could be that the /mnt/cdrom directory does not exist on your system (either create it or use another mount point). Maybe the CD is using MS Joliet (sp?) extensions and that needs to be supported in the kernel. You could also be typing the wrong command .

If you can''t mount it as root with "mount /dev/hdc -t iso9660 /mnt/cdrom", the drive might be 1) empty 2) broken 3) both, or the /mnt/cdrom doesn''t exist. Or you have no support in the kernel for iso9660 (doubtful), etc.

That''s why the error messages would help a lot.

So now make sure that the directory you''re trying to mount in (/mnt/cdrom) exists ("file /mnt/cdrom" must be a directory or a link to a directory) and/or try to provide more informations.

##### Share on other sites
Ok, I will give you the error messege, but I need to know how to copy in the command shell (if I can) it will be alot easier to tell you the messege if I could just Copy and Paste.

##### Share on other sites
Ok, I went into mnt/cdrom. Then I typed mount /mnt/cdrom mount:I could not determine the filesystem type, and none was specified.

##### Share on other sites
For future reference: just highlight the text and then middle click into the text area in your browser. Assuming you meant that you typed mount /mnt/cdrom and that you don''t have /mnt/cdrom in your /etc/fstab then you need to type mount /dev/whatever /mnt/cdrom. If it still doesn''t detect the filesystem type on its own, give it some help: mount -t iso9660 /dev/whatever /mnt/cdrom.

##### Share on other sites
Ok, I still dont know how to copy text, And this is what happend when I typed, mount /dev/cdroms/cdrom0 (That is the location) it said it could not find that in ect/ftab or ect/mtab. So should I tell it to mount the address fstab has?

##### Share on other sites
You didn''t read my post completely. I asked you to try giving it both the device and the path, not just the device.

##### Share on other sites
Ok, this is what I did and this is what happend (Im sorry, but I am still a newbie, so I wasnt excactly sure what you ment when you said Give it both Device and Path)
This is what happens when I say /mnt/cdrom:
[vegadam@localhost cdrom]$mount /mnt/cdrom /dev/hdc: Input/output error mount: I could not determine the filesystem type, and none was specified This is what I think you told me to do: [vegadam@localhost cdrom]$ mount -t iso9660 /dev/hdc /mnt/cdrom auto user, iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0/mnt/cdrom
mount: only root can do that
So I go into root and do it, and this is what it does:

[root@localhost root]# mount -t iso9660 /dev/hdc /mnt/cdrom auto user, iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0/mnt/cdrom
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options].
For many more details, say man 8 mount .

When I typed ls -l /dev/cdrom it said: lr-xr-xr-x 1 root root 16 Feb 21 14:33 (in red Bgcolor it said) /dev/cdrom -> ../cdroms/cdrom0
does the lr-xr-xr-x 1 root root have something to do with permisions that could be fucking this thing up?

Edited by - vegadam on February 21, 2002 10:49:06 PM

Edited by - vegadam on February 21, 2002 10:56:42 PM

##### Share on other sites
You''re confused . You''re using the fstab text for mount instead of the text we meant for mount . Here''s some exact text (based upon what I''ve read of your last attempt, assuming it''s all correct ) that should work as root:
mount -t iso9660 /dev/hdc /mnt/cdrom

Now, to make it so that you can mount the drive as any user you should add this to the bottom of your /etc/fstab file (you must add this as root):
/dev/hdc /mnt/cdrom iso9660 user,noauto,ro,defaults 0 0

After that''s in fstab you can type:
mount /mnt/cdrom

As any user and it should work.

##### Share on other sites
Ok, that gave me diferent output, but still no go.I think there is something wrong with my restrictions, but then again, I diont know much about Linux. When I did what you said, this is what it said:
[root@localhost /]# mount -t iso9660 /dev/hdc /mnt/cdrom
mount: block device /dev/hdc is write-protected, mounting read-only
or too many mounted file systems

Dont know what that means. Also, I dont think I can write in fstab, I go in the terminal and type cd /etc/fstab, and it says no directory,if I go through the windows, it will let me view it, but not edit it. Im sorry for all of this, and thank you all for your help thus far..

##### Share on other sites
Leave off the "-t iso9660" part maybe? Normally it can autodetect the format of the device you''re trying to mount (more info about partition types in the last AP''s post). BTW: /etc/fstab is a file, not a directory. But you do need to be root to edit it (like I said last time). To become root type "su" and then your password. This only makes that single terminal root, not everything though.

##### Share on other sites
This is quite odd. Are you sure that /dev/hdc is actually your cdrom? While most examples on the net will use /dev/hdc to refer to the CD, it''s not always the case (if you have multiple HD etc). Is your cdrom IDE? SCSI?

Have you tried to use the symlink rather than the block device (mount /dev/cdrom /mnt/cdrom rather than mount /dev/hdc /mnt/cdrom)? Also, what is the cd you''re trying to mount? Did you burn it yourself? It could be damaged (if you can read it on windows it''s probably not) or you could have to close the track. Are you sure it is iso9660? If it uses the MS extensions, you''ll need support enabled in the kernel. Or is it a rewritable CD?

I know that''s a lot of possibilities, but I suspect one of the following:

1) /dev/hdc is not the cdrom block device (but AFAIK it would then be a HD and thus already mounted, unless of course it''s not mounted on bootup),
2) the CD is damaged,
3) it uses a non-iso9660 file system (Joliet) and you''ll have to compile support for it in the kernel

Anyway, I''d suggest to try "mount -t iso9660 /dev/cdrom /mnt/cdrom" as root before trying any other option.

Don''t give up, Linux (and Unix in general) can be quite frustrating at time, but it''s very rewarding.

##### Share on other sites
Ok, I left it off, and this is what it said to me:
[root@localhost /]# mount /dev/hdc /mnt/cdrom
/dev/hdc: Input/output error
mount: block device /dev/hdc is write-protected, mounting read-only
/dev/hdc: Input/output error
mount: you must specify the filesystem type

Ok and this is what happend when I tried the other thing:
[root@localhost /]# mount -t iso9660 /dev/cdrom /mnt/cdrom
mount: special device /dev/cdrom does not exist
[root@localhost /]# mount /dev/cdrom/ /mnt/cdrom
mount: special device /dev/cdrom/ does not exist
[root@localhost /]#

Ok, here we go, The CD is not Damaged, and as for your other question, im not sure. But this is what the ISO is in fstab (By the way how do I edit fstab in the terminal I know I have to be in root)
iso8859-1

Edited by - vegadam on February 22, 2002 5:59:17 PM

##### Share on other sites
Try
mount -a  `
(i.e. mount all) then go see in /etc/mtab (list of mounted fs with the options) if the cdrom is mounted.

Yes, to edit /etc/fstab (and most other system files) you need to be su'ed as root.

note: it would be /dev/cdrom not /dev/cdrom/

Edited by - Fruny on February 22, 2002 6:07:19 PM

##### Share on other sites
[root@localhost home]# mount -a
[root@localhost home]# mount -a
[root@localhost home]# mount -a /dev/cdrom /mnt/cdrom
mount: special device /dev/cdrom does not exist

And I know I have to be in root to edit, but how do I edit, what is the command I should type?

This is what it says now.

Edited by - vegadam on February 22, 2002 6:17:05 PM