LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting Internal HD (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-internal-hd-854232/)

thorgamma 01-04-2011 05:23 PM

Mounting Internal HD
 
Trying to mount my internal hard drive that has all the data and is my long-time Windows drive. Debian is on the other drive.

This other drive will not mount with a simple mount command with the complaint that there is nothing about it in the /etc/fstab file.

So, I try to add to this file the last line shown:
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/sda / ext3 defaults 0 0

Two questions: 1) Should this work?
2) Why can't I seem to save it? I think I am "root" when I try to save it. If I go to the terminal screen now and type who, it gives me both my username and root.

Much obliged for any suggestions,

Thor

GrapefruiTgirl 01-04-2011 05:33 PM

Quote:

Originally Posted by thorgamma (Post 4213290)
Trying to mount my internal hard drive that has all the data and is my long-time Windows drive. Debian is on the other drive.

This other drive will not mount with a simple mount command with the complaint that there is nothing about it in the /etc/fstab file.

If there's nothing in fstab about a drive or partition, then the system is being asked to decide for itself what type of filesystem the device contains (that won't work - you need to tell it), and it doesn't know where to mount it - you need to tell it the mount location also. Finally, you'll need to tell it any particular options you wish to use when mounting the device, such as "readonly" or "users" or whatever. Without specifying these items on the CLI, the system relies on /etc/fstab.
Quote:


So, I try to add to this file the last line shown:
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/sda / ext3 defaults 0 0

Two questions: 1) Should this work?
No, for possibly 2 reasons:
1) you are trying to mount the drive on "/", which means "root filesystem". You cannot do that, since you already have a root filesystem mounted.
2) Unless the entire drive is one large partition (read: partitionless) then you will need to specify what partition to mount, such as /dev/sda2 or /dev/sda5 for example.
Quote:

2) Why can't I seem to save it? I think I am "root" when I try to save it. If I go to the terminal screen now and type who, it gives me both my username and root.
Please copy & paste for us, the exact data from your terminal, where you are running your commands - and show us the output produced, such as from the `who` command when you run it. You must be root, or use the `sudo` command, to edit a root-owned system file such as /etc/fstab. Also, you might want to try the `whoami` command instead.

Also, a couple tips:

-- Generally it is a good idea to let us know what Linux OS you are using when asking a question - in case it affects the exact commands, or locations of certain files, or use of `sudo` or not. Then folks don't need to ask what OS the problem is happening on. EDIT I see it is Debian - sorry.

-- Please use code tags when posting snippets from files, or console output. Tags will retain the text formatting, making it much easier to read what you've posted. Code tags:
http://www.phpbb.com/community/faq.php?mode=bbcode#f2r1

Any further questions, do feel free to elaborate!

Kind regards.

pljvaldez 01-04-2011 05:36 PM

The last line
Code:

/dev/sda / ext3 defaults 0 0
is incorrect for a windows drive. You can mount the partition without an fstab entry by specifying the file system type mount -t ntfs <devicename> <mountpoint>.

Can you post the output of fdisk -l as root so we can make sure you're trying to mount the correct partition?

johnsfine 01-04-2011 05:41 PM

GrapefruiTgirl covered most of what I would have said.

But in addition, I wonder if you are correct about sda being your Windows drive. It is certainly possible sda is your Windows drive and hda is your Linux drive. But it is a less common mix.

You should post the output from the following command as root:
Code:

/sbin/fdisk -l
That will tell us what drives and partitions you really have so our subsequent advice will be more accurate.

thorgamma 01-04-2011 09:14 PM

Quote:

Originally Posted by johnsfine (Post 4213309)
You should post the output from the following command as root:
Code:

/sbin/fdisk -l
That will tell us what drives and partitions you really have so our subsequent advice will be more accurate.

Thanks, johnsfine. Here it is:

Code:

Disk /dev/sda: 80.0 GB, 80025280000 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x136f136f

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        9728    78140128+  7  HPFS/NTFS

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdbbdab36

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        4660    37431418+  83  Linux
/dev/hda2            4661        4865    1646662+  5  Extended
/dev/hda5            4661        4865    1646631  82  Linux swap / Solaris


thorgamma 01-04-2011 09:32 PM

Thanks for the great detailed replies, GrapefruiTgirl and pljvaldez,
Here's the update: I tried
Code:

mount -t nfts /dev/sda1 /home
This looks like progress. There were no error messages after this command. However, now if I go to the /home folder on the GNOME file system and it gives me a message
Code:

Couldn't display "home/myname". Access was denied.
When I get back to this computer later today, should I try again, but pick a more appropriate directory to mount to? Was /home a bad choice? Or is this more likely a problem with the format of the files?

pljvaldez 01-05-2011 10:43 AM

Two issues: 1) the file system type is ntfs, not nfts, and 2)you have to create a separate mount point. /home is already used for your personal files. You have to think of the linux filesystem as a tree. / is called root, the base of the filesystem. Then you have some standard branches like /home, /bin, /sbin, /mnt, etc. When mounting a separate drive (an external USB drive, a non system internal drive, etc.) the typical convention is to create a new folder under the /mnt directory and use that.

So for example go to the /mnt by using the cd (change directory) command. Then make a new folder (mkdir) called windows. Then use the mount command to assign /dev/sda1 to the directory /mnt/windows.

aggrishabh 01-05-2011 11:10 AM

you have to make sure that your linux system should be able to read NTFS file system. As the old version of RHEL (If u r using)version don't have this abitity default. If you have FAT filesystem then no need of additional RPM,Just make a new directory wherever you want and mount the partions.

For permanent mountion you have to make an entry in fstab file.




Please correct me if i am wrong.

thorgamma 01-05-2011 09:01 PM

Quote:

Originally Posted by pljvaldez (Post 4214125)
Two issues: 1) the file system type is ntfs, not nfts,

I don't know how I goofed up the typing.

Quote:

... make a new folder (mkdir) called windows. Then use the mount command to assign /dev/sda1 to the directory /mnt/windows.
This worked! Here's what I did:
Code:

debian:/home/myname# cd /mnt
debian:/mnt# mkdir win
debian:/mnt# ls
win
debian:/mnt# mount -t ntfs /dev/sda1 /mnt/win
debian:/mnt# cd /mnt/win
debian:/mnt/win# dir
8ca1391d50a6567a9ccca9e209  installs          pagefile.sys
AUTOEXEC.BAT                    IO.SYS          Program\ Files
boot.ini                    launcher.log  Python27
CONFIG.SYS                    Log.txt          RECYCLER
Documents\ and\ Settings    MSDOS.SYS          SIERRA
EPSONREG                    My\ Music          stub.log
GS390GO                            Netgear          System\ Volume\ Information
hiberfil.sys                    NTDETECT.COM  temp
ifx                            ntldr          WINDOWS

Next, I'll work on permissions, etc. Hopefully, I can do that without help. Thanks a ton!

thorgamma 01-05-2011 09:04 PM

Quote:

Originally Posted by aggrishabh (Post 4214149)
you have to make sure that your linux system should be able to read NTFS file system. As the old version of RHEL (If u r using)version don't have this abitity default. If you have FAT filesystem then no need of additional RPM,Just make a new directory wherever you want and mount the partions.

Looks like it's reading okay.

Quote:

For permanent mountion you have to make an entry in fstab file.
Please correct me if i am wrong.
I'll have to figure out how to do that next. Thanks!

thorgamma 01-08-2011 11:15 PM

One computer two hard drives - set up to read windows drive
 
This is to summarize what it took to get this to work (but one open issue - see bottom):

1. Mounted the hard drive:
Code:

mount -t ntfs-3g /dev/sda1 /mnt/win
You might like to call it /mnt/windows if you're not into the whole brevity thing.

2. edit the fstab file in /etc folder to include:
Code:

/dev/sda1      /mnt/win        ntfs-3g    rwx, user      0      0
(Of course, this should be adjusted for the first entry to match the drive ID and the second entry to match how where it is mounted.

3. If you don't have ntfs-3g, you need to get the package. I did this on my Debian installation, I used the Synaptic Package Manager to find and install the package. (This SPM is found on GNOME under the System drop-down menu.

Open Issue: There is something wrong with the fstab: I get the message:
[code]Can't find /mnt/win in etc/fstab or /etc/mtab. Therefore, it doesn't mount the hard drive.


All times are GMT -5. The time now is 11:20 PM.