Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 23
I will try to calm down cause linux has given me a rough day today, so i can explain myself to all of you. Ok, i want to know how ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342

    Which file to mount?


    I will try to calm down cause linux has given me a rough day today, so i can explain myself to all of you.

    Ok, i want to know how to find out which file in /dev i am supposed to use to mount my data partition. Usually, i gets loaded up into fstab so it gets automounted. Now, i can't reboot or turn off the computer to see if it gets mounted cause the stupidity does not have the option. If i click on the start button and click Logout, it does not show me the screen i am used to where i could choose to logout, restart or turn off.

    Now, all i want to know is how to find which of the bunch of hda and hdc and hdd is my partition. All i see is some weird name when i run ls in the dev directory. I supose @ is like a link or something, but all the research i've done goes like, type mount /dev/whatever /mnt/whatever2. This makes no sense to me, cause later on if you want to have that thing mounted when the os boots up, you must type some other stuff in fstab on /etc.

    Please, help me calm down and avoid returning to windows.

    Ok ok, i did it with the partition thing on the control center, but now i get a damn message that only root can mount that ****. Of course, but how do i do it as root without the console that is not working for me either.

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    okay...
    you seem to be asking about several things, so I'll try to answer as many as I can:
    the reason that you "mount" something and don't just put it in your fstab is because you don't want everything brought up at boot each time. Perhaps you have a memory stick or something that you don't plug in everytime, etc.
    This is generally how the hda,b,c thing goes:
    /dev/hda --> first IDE (generally your primary hard drive)
    /dev/hdb --> same IDE as hda (perhaps like a "slave" drive)
    /dev/hdc --> next IDE (generally your first cd drive)
    /dev/hdd --> your next IDE drive (secondary cd drive)

    To find out which partitions are on a drive, do this as:
    Code:
    fdisk -l /dev/hda
    replacing hda with whichever disk you want to see.
    -lakerdonald

  3. #3
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    The files in the directory /dev are not "real" files. There's nothing to see by running ls in a /dev file, except in the case of symbolic links, like:
    Code:
    # ls -al /dev/mouse
    lrwxrwxrwx    1 root     root           10 Aug 20 21:57 /dev/mouse -> /dev/psaux
    As for the partition that you want to mount, Linux should recognize that as a device. The /dev directory can't tell you anything about that device, but to mount it you do need to know what "dev" it is, the method for which lakerdonald has explained. Once you know the name that Linux calls a device, then you will be able to mount the device, giving a name you can use. /etc/fstab is the file that Linux uses to automatically mount filesystems. Since not all filesystems are to be mounted automatically everytime you boot (removable media, usb drives, etc.), mount can basically over-ride what fstab says. But then, since mount is a command, it's not persistent: that is, the filesystem you just mounted with 'mount' will not be mounted after re-booting. Unless you edit /etc/fstab. After that, the system will always try to mount it, whether it's connected or not.

    Ok ok, i did it with the partition thing on the control center, but now i get a damn message that only root can mount that ****. Of course, but how do i do it as root without the console that is not working for me either.
    Only root can mount filesystems (partitions, floppies, CDs, cameras) unless those filesystems are included in /etc/fstab. If you think about it, you'll see how otherwise, there would be a major security hole. As for your console not working: are we talking about a console in X-windows, or a terminal (text-only) console? If it's the first, do ctrl-alt-F4 to see if you can get virtual console 4 (tty4) and then do whatever command line work you want. Do ctrl-alt-F7 to return to X-windows. If you have a graphic screen, but you can't get to the text-only screen (as in foregoing), try exiting X-windows with ctrl-alt-Backspace. Return to X-windows with "startx". And take a deep breath and step away from the windows.
    /IMHO
    //got nothin'
    ///this use to look better

  4. #4
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    Yeah, no prob about windows, i didn't do it.

    Now, about the mounting, how can i tell or where is the partition where all my info is? I know i gotta mount the device and then add it to the fstab file, but the point is that i don't know which file i have to put in the first parameter for mount, like so:
    Code:
    mount device1 location
    device1 is the one i don't know. How do i find it out?

    Here's part of what i got typing ls -al on /dev/:
    Code:
    lr-xr-xr-x    1 root     root           32 Jan 14 08:50 hda -> ide/host0/bus0/target0/lun0/disc
    lr-xr-xr-x    1 root     root           33 Jan 14 08:50 hda1 -> ide/host0/bus0/target0/lun0/part1
    lr-xr-xr-x    1 root     root           33 Jan 14 08:50 hda2 -> ide/host0/bus0/target0/lun0/part2
    lr-xr-xr-x    1 root     root           33 Jan 14 08:50 hda5 -> ide/host0/bus0/target0/lun0/part5
    lr-xr-xr-x    1 root     root           33 Jan 14 08:50 hda6 -> ide/host0/bus0/target0/lun0/part6
    lr-xr-xr-x    1 root     root           33 Jan 14 08:50 hda7 -> ide/host0/bus0/target0/lun0/part7
    lr-xr-xr-x    1 root     root           35 Jan 14 08:50 hdc -> ide/host0/bus1/target0/lun0/generic
    lr-xr-xr-x    1 root     root           30 Jan 14 08:50 hdd -> ide/host0/bus1/target1/lun0/cd
    Am i explaining myself enough? Tell me, help me help you so you can help me back. Jejeje.

  5. #5
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    Ok, now, either i am really stupid or the guy with the worst luck ever.

    Here's what i've done so far to mount that partition. I went to the control center>mount points. There, it says that hda1 (the partition i want to access) is mounted at /mnt/backup. Here's the entire text:
    Mount point: /mnt/backup
    Device: hda1
    Type: some **** ext3
    Size....
    Formatted
    Mounted

    To get this i typed "mount /dev/hda1 /mnt/backup". It went down fine. Then i edited etc/fstab adding this line:
    "/dev/hda1 /mnt/backup ext3 defaults 1 1" so it would be automounted at startup, correct? Ok, so, having done all this, i went to the desktop to create a hard disk, you know the icon, selected the mount point and the icon appeared. Here's where the **** continues to hit the fan: an error pops up and says "The file or directory /mnt/backup does not exist".

    Can somebody walk me through this mounting insanity. It seems i am not getting the point. Thanks!!!

  6. #6
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    The first thing to look at is where you have "Type: some **** ext3". Now, I expect what it probably said was "Type: journalized FS: ext3" which means the partition was formatted for Linux, and not for Windows. If your Windows is still working, then we have not correctly identified the Windows partition. I would like for you to post your partition table and your fstab. Guessing that you may have to use Windows to get to the internet, this may be helpful:
    Code:
    $  su -		      	(switch to root user)
    Password:		       (enter root password)
          (insert a Windows-format floppy in the drive)
    # mount /mnt/floppy
    # fdisk -l /dev/hda > /mnt/floppy/fdisk.txt
    # cat /etc/fstab > /mnt/floppy/fstab.txt
    # mount > /mnt/floppy/mount.txt
    # umount /mnt/floppy
    Note that the character following "fdisk" is an L and not a one. If you can access this forum from Linux, you can skip the floppy part and replace the "/mnt/floppy/filename" part with "Desktop/filename", or whatever. Point being that once you have written the files, you will need to copy and paste them here in your reply.
    /IMHO
    //got nothin'
    ///this use to look better

  7. #7
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    I have no windows and the other 2 partitions are ext3, the thing is that i see too many h... on /dev, so i can't tell which one to mount. And yeah, i have to mount the other cd rom/cd rw drives. So that's another 2 months. Jejeje.

    Here's the file you requested (/etc/fstab):
    Code:
    /dev/hda7 / ext3 defaults 1 1
    /dev/hda1 /mnt/backup ext3 defaults 1 1
    none /dev/pts devpts mode=0620 0 0
    /dev/scd0 /mnt/cdrom auto user,iocharset=iso8859-1,codepage=850,noauto,ro,exec 0 0
    /dev/hdd /mnt/cdrom2 auto user,iocharset=iso8859-1,codepage=850,noauto,ro,exec 0 0
    /dev/fd0 /mnt/floppy auto user,iocharset=iso8859-1,sync,codepage=850,noauto,exec 0 0
    none /proc proc defaults 0 0
    /dev/hda6 swap swap defaults 0 0
    There's the hda5 that i suppose is the partition to mount. But that's exactly my point, how do i know which device is my partition backup and how do i mount it?

  8. #8
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    Assuming that this is a working system, and you haven't edited /etc/fstab since you booted and you didn't get any error messages about not being able to mount a partition, then it would appear that you have at least 5 partitions on hda that might hold data. You can see that hda7 is the root (/) partition and hda1 should be your backup partition (but in a Linux file format). Not counting hda6 which is swap and hda4 which is an extended partition, there is still hda2, -3, and -5. There may be something beyond 7, as well. The result of running 'fdisk -l /dev/hda' would help alot in clarifying this.

    Or you can do this:
    Code:
    # mkdir /mnt/hda2
    # mount /dev/hda2 /mnt/hda2
    # mkdir /mnt/hda3
    # mount /dev/hda3 /mnt/hda3
    # mkdir /mnt/hda5
    # mount /dev/hda5 /mnt/hda5
    For those that get no errors, look at them in your file manager or do 'ls /mnt/hda2' to see if you recognize what's there. Any commands you don't understand, you should do 'man commandname' first, so you'll know what's happening.
    /IMHO
    //got nothin'
    ///this use to look better

  9. #9
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    Ok, i mounted hda1, which is my partition (i typed the ls /mnt/hda1 command that you suggested after mounting it and all my folders appeared over there :P ), should i go ahead and add the following line to fstab?

    Code:
    /dev/hda1 /mnt/hda1 ext3 defaults 1 1
    Just so i get it down already. Adding this line will get my hda1 mounted every time i load linux correct? Another thing, i just added this to my fstab file, restarted the system, made a new icon on the desktop to /mnt/hda1 that appeared on the device list and the icon appeared on the desktop. But i am still not done with errors: when clicking the icon to open the drive, i get a message that says the following: "The file or directory /mnt/hda1 does not exist". What have i done wrong???

    I have come down to a conclusion: since i can see the /mnt/hda files from a terminal as root, i guess the damn thing is mounted. Now, the real issue now would be: how do i make it available to the rest of the users? And byt he way, how do i make it a directory instead of just a file you pick up when an open file dialog comes up?

  10. #10
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    Okay, sheds, it looks like we have progress, and clearly you're catching on to how things work. Once you have confirmed that you can mount a partition with no problems, it's okay to add it to your fstab. For access by other than root, I think you just need to replace "defaults" with "users". If you don't want to mount it every time you boot, but you want it to be convenient to mount, you can add "noauto" to that, something like this:
    Code:
    /dev/hda1		/mnt/hda1		ext3	noauto,users	1 1
    I have a couple of partitions that I treat this way. I have a "Disk Management" launcher on my screen that I can click and get a dialog box that shows what drives or partitions I can mount: it shows all the mounts in fstab, whether mounted or not. I just have to select a partition and then mount it. That's with Gnome in Fedora Core 1, but you can probably work out the same thing in your sytem.

    Quote Originally Posted by sheds
    But i am still not done with errors: when clicking the icon to open the drive, i get a message that says the following: "The file or directory /mnt/hda1 does not exist". What have i done wrong???
    If you mounted it as root and you get this message as another user, you've probably done nothing wrong. That's one of Linux's ways of saying "permission denied". See the part about adding "users" above.
    Quote Originally Posted by sheds
    And byt he way, how do i make it a directory instead of just a file you pick up when an open file dialog comes up?
    I'm not quite sure what you mean there. You don't have to mount the partition at /mnt/. You could do mount /dev/hda1 /home/sheds/backup if that's what you like.
    /IMHO
    //got nothin'
    ///this use to look better

Page 1 of 3 1 2 3 LastLast

Posting Permissions

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