×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Can't view files in external HD
2

Can't view files in external HD

Can't view files in external HD

(OP)
Hey guys,

Just to start, I am fairly new in the linux world, so with this question, please excuse what seems to be my ignorance... I have a web server on CentOS 4.4. I have attached a 500GB external hard drive. I want to mount this drive, but before I do that, I have to figure out what drive it is. I have checked the /dev folder and noticed that there is sda, sda1, sda2, sdb and sdb1... I am not sure which drive is the one I just attached... I tried the df command and here is what I got...


[root@host ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                     115952076  24250252  85811776  23% /
/dev/sda1               101086      9288     86579  10% /boot
none                    647372         0    647372   0% /dev/shm


Again, I have not mounted the drive yet, so I'm not sure if it would even be on the list above. My main goal is to use this drive as backup for websites that I host because ftp isn't working as I planned it. If anyone can help me to mount and be able to view files and save files to this drive it would be greatly appreciated. Thanks!

Brad L. - MCP

"If the doctors told me I had 5 minutes to live, I would type faster."

RE: Can't view files in external HD

Try doing a

CODE

$ dmesg | tail

This usually will reveal what was mapped to the device you just plugged in.

When you go to mount it, you will need to tell it to allow your user to read/write. To identify this, use

CODE

$ whoami
<user>
$ cat /etc/passwd | grep <user>
<user>:x:1000:1000:User Name:/home/<user>:/bin/bash

The first number (in this case, 1000) is the user number you need. Then mount the device (as an example):

CODE

$ mount -o uid=1000 /dev/<device> /mnt/usb
 

RE: Can't view files in external HD

(OP)
Okay, I found the device (happened to be /dev/sdb1) and i tried to mount it but to no avail... I kinda figured Linux doesn't support NTFS file systems. I need to make this external HD available in linux so new question... How do I make this drive or change the file system on this drive so Linux will recognize it??? Thanks!

Brad L. - MCP

"If the doctors told me I had 5 minutes to live, I would type faster."

RE: Can't view files in external HD

Linux has supported NTFS filesystems for a few years, now. I don't know about CentOS 4.4 specifically, but if it's relatively recent (looks like it's 2006-ish?), I'd expect it to support NTFS.

So the real question is: why did your attempt to mount it fail? What command did you try and what error did you get?

RE: Can't view files in external HD

(OP)
I tried to mount sdb and sdb1 (just in case) and heres what I got...


[root@host ~]# mount /dev/sdb /mnt/usbdrive
mount: you must specify the filesystem type
[root@host ~]# mount /dev/sdb1 /mnt/usbdrive
mount: fs type ntfs not supported by kernel


As you can see, when mounting sdb, it says I must specify the filesystem type which I find odd because it gives me an error telling me that the filesystem type isn't supported when trying to mount sdb2 (same command). IDK, any help is still appreciated...

Brad L. - MCP

"If the doctors told me I had 5 minutes to live, I would type faster."

RE: Can't view files in external HD

/dev/sdb is the entire disk; it has no filesystem, so mount can't tell what filesystem it should be mounting. /dev/sdb1 and /dev/sdb2 are partitions; those apparently do have filesystems it recognizes as NTFS, so it is able to complain that it is unsupported.


Run:

CODE

uname -r
That tells you your current kernel version; what is it?

Run:

CODE

ls -A /boot
Do you see any files named config-something  or .config-something? Try to find one corresponding to your current kernel version and run:

CODE

grep NTFS /boot/config-whatever
What's the output?


It looks like CentOS 4.4 is probably from 2005 or earlier, so it may be a bit too old to have support for NTFS.

Does CentOS have any newer kernel packages available for you to install on 4.4? If you have yum, you can probably run:

CODE

yum list available |egrep 'linux|kernel'
to see what's available. Otherwise, look wherever you normally look for package updates.
 

RE: Can't view files in external HD

If you don't want to carry on using NTFS on the drive a just want it for Linux then reformat is as ext3.

# fdisk /dev/sdb
command (m for help): p
this will display the current partitions.
command (m for help): d
to delete the existing partition
command (m for help): n
this will prompt for various information to add the new partition(s).
command (m for help): w

You now have a usable partition you need to format it with a file system:

# mke2fs -j -L 'label' /dev/sdb1 (2/3/4 - depends how many partitions you want to create).

You can then mount the disk:

# mkdir /data1

# mount -t ext3 /dev/sbd1 (or 2 or 3, etc) /data1

You should be able to access the disk.

 

Lee Mason
Optimal Projects Ltd
www.opl.co.uk
www.backupsanywhere.com

RE: Can't view files in external HD

Note that the above will not preserve any existing data on your disk.

RE: Can't view files in external HD

In addition to not preserving the above, it won't be usable with Windows anymore.

You could probably format it as FAT32 if you need access both in Windows and linux. However, Windows places a 32GB partition limit on FAT32 devices, and there is no such limit if you use linux's tools to format.

RE: Can't view files in external HD

(OP)
Thank you guys for all of your help... I would really like to update the kernel, but I'm not sure if I should... Our web servers (the ones I am trying to attach these drives to) have 99.9% uptime, and I don't think it would be worth the reboot, I may end up with a lot of really pissed customers, although I am considering it... I'm pretty sure I will just reformat the disk to ext3, I would like to swap it between windoze and Linux, but it's not necessary. Thank you guys for all of your help, these forums have saved my job a few times :)

Brad L. - MCP

"If the doctors told me I had 5 minutes to live, I would type faster."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close