Connecting ān external harddisk via usb to Redhat Linux
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Connecting ān external harddisk via usb to Redhat Linux
Sorry if this has been asked before, but I couldn't find it.
I am a Linux newbie.
I'm logged in as root to an installation of Red Hat Enterprise ES (2.4.21-4 EL). I didn't install it. There don't seem to be that many useful tools around and I'm not familiar with working at the terminal? prompt.
I've connected an external hard disk by a usb port. It's got an ntfs primary partition. I want to copy some files into a partition. I can open the directory I want to copty the files into, I know drag and drop works!
I can't find the USB partition anywhere!
Should it be somewhere like /dev/, it isn't.
Should it be somewhere like /mnt/, it isn't.
If there was something like disk administrator/management I'd be able to see where it was, but there isn't.
Help!
The mount command posted above isn't quite right because the device of a partition will look like /dev/sdc1 for the first partition on the /dev/sdc drive.
You can enter the root command "fdisk -l" to list the partitions detected. Since this is an ntfs drive, you might consider re-formatting it to another filesystem if you aren't using this drive for an xp computer. The vfat filesystem is better for sharing files between windows and Linux. A native filesystem should be used if you use drive for Linux.
Otherwise, check if you have the ntfs kernel module loaded:
/sbin/lsmod | grep ntfs
You may need to load the kernel module if not:
sudo /sbin/modprobe ntfs
Another way to find out which device is used is to monitor the kernel messages and then plug in the usb cable.
sudo tail -f /var/log/messages
It should mention which device was used.
Of course you could simply list the possible devices:
ls /dev/sd*
Typing "mount" by itself will show you which devices are currently mounted, so a process of elimination should tell you which device it is.
On my CentOS5 box (the equivalent of RH5), a usb drive appears as /dev/sdc or similar. This then needs to be mounted at the relevant spot
I use mount -a /dev/sdc /mnt/usb
but I guess you would need to use
mount -t ntfs /dev/sdc /mnt
(replace the relevant drive for sdc)
You should then be able to copy across
Note - fdisk -l should give you an idea of what device your usb drive is
Thanks, this was a great help. All those graphical tools and I just _knew_ it would come down to the terminal window! ;-)
BTW is there a quick way of repeating what you type in a terminal window? Like f8 in windows?
There is a problem however which is it says fs type ntfs not supported by the kernel
jasee, linux is way better than windows for repeats. Hit the up arrow key - page up takes you to the first retained entry, page down to the last. How many depends on the distro, but there are 10's of previous commands available.
You don't use sudo if you are root. I will use sudo as a regular user to mount directories, but I must admit that I will su to root before examining log files in /var/log. Are you certain that you didn't use capital letters when you tried "modprobe ntfs".
I'm not familiar with your version of Red Hat. At one time, with Fedora Core 1, ntfs support was not enabled in the kernel by default. Since you didn't install it yourself, it could also be the case that the compiler was compiled from source by the previous user. You might want to search in the kernel's configuration file. If the kernel source is installed, look at the .config file. If this is the stock kernel, there may be a copy in /boot called config-<version>. Also if enabled there may be a /proc/config.gz file: "zcat /proc/config.gz | grep NTFS". Below is how my stock SuSE kernel is configured for NTFS:
If you want to write to the drive as well, use ntfs-3g as the filetype instead of ntfs. I think you need to first modprobe the fuse module, I'm not certain whether you need the ntfs module if you use ntfs-3g.
Code:
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y
If CONFIG_NTFS_FS is commented out, you don't have NTFS support compiled in the kernel. Either reconfigure the kernel or install a kernel rpm that has it enabled.
---
I just mounted the Windows XP partition on my harddrive. It is /dev/sda1, and the mount-point is /mnt/xp.
Code:
sudo mount -t ntfs-3g /dev/sda1 /mnt/xp -o rw,uid=jschiwal,gid=jschiwal,fmask=0117,dmask=0007
jschiwal@hpamd64:~> ls -ld /mnt/xp
drwxrwx--- 1 jschiwal jschiwal 24576 2007-10-21 02:59 /mnt/xp
Code:
/dev/sda1 on /mnt/xp type fuseblk (rw,nosuid,nodev,noatime,allow_other,default_permissions,blksize=4096)
There is a manpage for ntfs-3g (man 8 ntfs-3g") that contains a list of the mount options. You need either to use the "uid=" mount option to make yourself the owner of the mounted partition, or use "fmask=111,dmask=000" and access the drive as "o"thers.
I'm not familiar with your version of Red Hat. At one time, with Fedora Core 1, ntfs support was not enabled in the kernel by default. Since you didn't install it yourself, it could also be the case that the compiler was compiled from source by the previous user. You might want to search in the kernel's configuration file. If the kernel source is installed, look at the .config file. If this is the stock kernel, there may be a copy in /boot called config-<version>. Also if enabled there may be a /proc/config.gz file: "zcat /proc/config.gz | grep NTFS". Below is how my stock SuSE kernel is configured for NTFS:
If you want to write to the drive as well, use ntfs-3g as the filetype instead of ntfs. I think you need to first modprobe the fuse module, I'm not certain whether you need the ntfs module if you use ntfs-3g.
Code:
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y
If CONFIG_NTFS_FS is commented out, you don't have NTFS support compiled in the kernel. Either reconfigure the kernel or install a kernel rpm that has it enabled.
There is a manpage for ntfs-3g (man 8 ntfs-3g") that contains a list of the mount options. You need either to use the "uid=" mount option to make yourself the owner of the mounted partition, or use "fmask=111,dmask=000" and access the drive as "o"thers.
Thanks for your advice, however you do realise you are talking to a Linux newbie? A lot of this stuff is completely over my head. At terminal prompt I did "zcat /proc/config.gz | grep NTFS" and I got no such file or directory. I also did mount -t ntfs-3G /dev/sdd1 /mnt and I got fs type ntfs-3g not supported by the kernel. So I presume this isn't there either? Not that I need to write to that partition - only read.
So it looks as though I have to "recompile the kernel", whatever that is?
Help!
hi jasee,
I understand you are a newbie....
I will put it simply - you donot have ntfs support in your default linux instln (kernel) . Either you fix it or get a new kernel.
If you wish to upgrade your kernel let me know , I will walk you through that and you will have ntfs support. Then you can think of the fdisk -l and the partition stuff to mount it.
bye
nishith
hi jasee,
I understand you are a newbie....
I will put it simply - you donot have ntfs support in your default linux instln (kernel) . Either you fix it or get a new kernel.
If you wish to upgrade your kernel let me know , I will walk you through that and you will have ntfs support.
Thanks, if you've got the time, I need to fix it
(not get a new kernel as this means a whole new version?, which I don't want).
I did realise that I (the operating system) didn't have ntfs support.
I don't know whether it's important, but I don't have any disks.
yeah sound's difficult at first but trust me it's simple.
Just go to kernel.org site and download the linux-2.6.22.6.tar.bz2 file from it.
This is all you need.
Then cd to /usr/src and execute the following command tar -jxvf linux-2.6.22.6.tar.bz2
A lot of things will scroll past on your screen and when that stops you will have a dir linux-2.6.22.6 under /usr/src
cd to the dir and do the following make menuconfig
it shall open up a menu driven program now scroll down to the filesystems item in the list and navigate in it to find out the FAT32 and NTFS support . you got to press Y to enable it.
once you are done just save and exit.
the commands to navigate and save and exit can be easily found by reading the prompts at the end of the screen.
next do make
this will take some time and things will go past your screen
next do make modules
next make modules_install
next make install
that's all reboot your system, you will see in grub or lilo a option called linux-2.6.22.6 just choose it and boot up
you are almost there and if you have been able to do this much get back here and we shall see you through the rest.
Is that okay ?
nishith
yeah sound's difficult at first but trust me it's simple.
Just go to kernel.org site and download the linux-2.6.22.6.tar.bz2 file from it.
This is all you need.
Then cd to /usr/src and execute the following command tar -jxvf linux-2.6.22.6.tar.bz2
A lot of things will scroll past on your screen and when that stops you will have a dir linux-2.6.22.6 under /usr/src
cd to the dir and do the following make menuconfig
it shall open up a menu driven program now scroll down to the filesystems item in the list and navigate in it to find out the FAT32 and NTFS support . you got to press Y to enable it.
once you are done just save and exit.
the commands to navigate and save and exit can be easily found by reading the prompts at the end of the screen.
Thanks very much for your help, I've got this far. (But I've not enabled fat32 as I don't need it). I've got a whole lot of apparent error messages of the form "warning trying to assign nonexistent symbol etc..."
Can you tell me what I'm doing after this step, am I replacing the kernel or will I be able to boot into the alternative configurations when I boot up?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.