LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-12-2006, 11:01 PM   #1
lerad512
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Rep: Reputation: 0
Can't mount second hard drive, wrong fs type?


Great sites like this convinced me to switch to Linux at home. I'm still a newbie, though, so I'll need some help.

In addition to a primary hard drive (where Kubuntu is installed), I've got a second drive that I'm having trouble mounting. When I try to mount it from the KDE GUI, I get an error that says, "mount: can't find /dev/hdb1 in /etc/fstab or /etc/mtab". When I try from the command line by typing "sudo mount -t ntfs /dev/sdb1 /media/sdb1", I get an error that says, "mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or other error".

My guess is that I'm having this problem because the drive is still NTSF, from when I was running Windows. Maybe I need to install NTSF support into the OS, or something? (I'd be surprised if that's it; I have two external hard drives that I believe are NTSF, and I can mount them with no problem.) I probably just need to add the right thing to fstab, but I don't know what that thing is. If anyone could give me a hand, I'd appreciate it!

Here's the contents of /etc/fstab:

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
 
Old 08-12-2006, 11:31 PM   #2
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
After you try to mount /dev/sdb1 (sudo mount -t ntfs /dev/sdb1 /media/sdb1) and it gives you that error, try:
Code:
dmesg | tail
That will print out the last few lines of the kernel log. More details about the error will be available there. Post them.

By the way, are you sure that it's ntfs? The filesystem of a device that you want to mount can often be detected without being specified on the command line. Try the same mount command but omit the -t ntfs part.

Last edited by zhangmaike; 08-12-2006 at 11:33 PM.
 
Old 08-13-2006, 12:33 AM   #3
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
My guess is that there is no hdb1 entry in /etc/fstab
Quote:
I get an error that says, "mount: can't find /dev/hdb1 in /etc/fstab or /etc/mtab".
Quote:
Here's the contents of /etc/fstab:

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
Add an entry for that drive and all should be ok.
/dev/hdb1 /mnt/foldername ntfs auto,users,rw 0 0

I know that on my systems I have to have ntfs support compiled into the kernel, I don't know if kubuntu has this by default.

Hope that helps.

Last edited by lord-fu; 08-13-2006 at 12:35 AM.
 
Old 08-13-2006, 12:47 AM   #4
lerad512
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Well, I wasn't sure that it's NTSF, you're right. And after looking at the kernel log, it looks like it isn't. Here's the last bit:

[17181723.804000] NTFS-fs error (device sdb1): read_ntfs_boot_sector(): Primary boot sector is invalid.
[17181723.808000] NTFS-fs error (device sdb1): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
[17181723.808000] NTFS-fs error (device sdb1): ntfs_fill_super(): Not an NTFS volume.

I tried "sudo mount /dev/sdb1 /media/sdb1", and got an error that says, "mount: you must specify the filesystem type". I tried a couple other variations, too: "-t vfat" got me the same sort of error as with NTFS, and "-t auto" was not recognized.

Thanks for your help so far. If anyone has more insight, I'd appreciate it.
 
Old 08-13-2006, 01:26 AM   #5
lerad512
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Original Poster
Rep: Reputation: 0
I added an entry to /etc/fstab: "/dev/hdb1 /mnt/hdb1 ntfs auto,users,rw 0 0" and created a hdb1 directory in /mnt. It sort of seems like it did something. At least, when I ran "sudo mount -a", it didn't generate any errors. But I can't access "/mnt/hdb1". When I try in KDE, it gives me "Could not enter folder /mnt/hdb1" and when I try in the console I get "bash: cd: /mnt/hdb1: Permission denied".

Under "ls -al" the directory looks like this:

dr-x------ 1 root root 12288 2006-08-12 09:02 hdb1

I thought that maybe that was the source of the permissions error, but if I try to broaden the permissions or change its ownership, I get an error that says, "Read-only file system".
 
Old 08-13-2006, 03:00 AM   #6
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
A directory must have execute permissions for you to enter it with cd. For that directory (according to the output from ls), only root has execute permissions, and the owner group and other users do not. Read permissions for the other users couldn't hurt either.

Do, as root:
Code:
chmod go+rx /mnt/hdb1
Quote:
I get an error that says, "Read-only file system".
If the mount did succeed, you might have to unmount it first. The linux kernel has read support for ntfs, but no real write support. If it has been mounted, it would've been mounted read-only... I'd guess that's where this error is coming from.

Last edited by zhangmaike; 08-13-2006 at 03:03 AM.
 
Old 08-13-2006, 02:24 PM   #7
lerad512
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Original Poster
Rep: Reputation: 0
When I unmount the drive I can chmod, but when I mount the drive again the permissions go back to what I posted above and I can't enter the directory.

Is there a way to tell what filesystem I've got on this drive? Like I said before, I'm not sure it's NTFS, but I don't know what else it might be. Better yet would be to have it auto-detect when it mounts but that option doesn't seem to work.
 
Old 08-13-2006, 05:12 PM   #8
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Since the entry in fstab specifies ntfs, and it mounts properly, I'd guess that the filesystem is indeed ntfs. Here's an excerpt from the mount
manpage about options for ntfs:
Code:
       uid=value, gid=value and umask=value
              Set the file permission on the filesystem.  The umask  value  is
              given in octal.  By default, the files are owned by root and not
              readable by somebody else.
It seems the r-x------ permissions might be a result of the default options. Try specifying umask=000 in your list of options in fstab - this will not restrict the permissions at all (although you may want to tighten this down after testing is through). Setting umask=022 would probably be a better choice... this gives write permissions only to the owner and read/execute permissions to everyone.
 
Old 08-13-2006, 11:24 PM   #9
lerad512
LQ Newbie
 
Registered: Jul 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Victory! The new entry in /etc/fstab is:
Code:
/dev/hdb1 /mnt/hdb1 ntfs auto,users,ro,umask=022 0 0
Now I can mount the drive with no problem. Thanks so much for your help!
 
  


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
can mount C not D FAT: invalid media value (0x45) mount: wrong fs type, bad option Emmanuel_uk Linux - Newbie 10 11-29-2005 03:47 AM
Knoppix can't mount hdd, wrong fs type castortroy Linux - Hardware 5 11-27-2005 12:43 AM
cant mount the cdrom - wrong medium type UddUnderline Mandriva 3 02-15-2005 08:42 AM
mount: wrong fs type sbrewer Linux - Hardware 3 12-10-2004 11:10 AM
What do I type to mount the new hard drive? randon Linux - Newbie 15 10-16-2003 10:47 PM


All times are GMT -5. The time now is 08:35 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