Archived

This topic is now archived and is closed to further replies.

Linux and NTFS

This topic is 5671 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Folks, I need your help, please. I have a Win2k box with 2 hdds. Some time ago, I managed to install RedHat Linux on the second hdd, and to setup a dual boot. It was a pain, but it works. I mainly use Windows, Linux is just for fun (and I am a absolute n00b in Linux). What I''d like to do is to mount the first hdd somehow, so I can use it from Linux. The file system here is NTFS. I struggled my way thru the documentation for ''mount'', and finaly came up with something like
mount /dev/hda1 /ntfs -t ntfs
 
Linux was so kind to tell me something like
mount:fs file system ntfs not supported by kernel
 
A quick Google confuzed me even more Could you please guide me on this issue? TIA, Gabriel Forever trusting who we are And nothing else matters - Metallica

Share this post


Link to post
Share on other sites
As a note: NTFS writing is still experimental, and I don''t think any of the stable kernels allow you to enable it. NTFS reading is pretty safe though. Obviously, for these ''features in the works'', a newer kernel is better, but you probably want to stay in the stable release (especially if you''re new to Linux), so NTFS writing may not be an option for you.

Share this post


Link to post
Share on other sites
Oluseyi:
Thanks for the tip. I did that using "make xconfig". In the dialog that popped up I selected file systems, and checked NTFS (read only). Then I started the build (I cannot remember the command, but it was the one "make config" said I have to use).
The build returned no error, but as I rebooted the system, GNOME hung at the startup process. I had to make a cold boot, and Linux is screwed now. It checks some volumes, finds some critical error, and says I have to use "fsck" manually. And now I am stuck. Could you help me further, please - a few side comments were helpfull getting "the big picture". TIA.

Null and Void:
Yes, my only desire is to be able to read the NTFS partition. I''d like to be able to copy some source files from there and compile them under Linux. The whole thing is just for educational purposes.

I know that the questions I am asking are very basically (and some of them probably not very smart). Thank you for your patience.

Forever trusting who we are
And nothing else matters
- Metallica

Share this post


Link to post
Share on other sites
quote:
Original post by Gabriel Fleseriu
Thanks for the tip. I did that using "make xconfig". In the dialog that popped up I selected file systems, and checked NTFS (read only). Then I started the build (I cannot remember the command, but it was the one "make config" said I have to use).

So, to make sure I understand you: you went through the entire "make dep", "make modules", "make modules_install", "make bzImage", move the bzImage, and setup LILO/GRUB process, correct?
quote:
Original post by Gabriel Fleseriu
The build returned no error, but as I rebooted the system, GNOME hung at the startup process.

Try booting into console incase you need to setup a driver or something for X with your new kernel.
quote:
Original post by Gabriel Fleseriu
It checks some volumes, finds some critical error, and says I have to use "fsck" manually.

Do what it says and everything should be fine (about the critical error, that is, maybe not other things). You almost certainly caused the critical error by restarting the system when it wasn''t ready (you may have not had a choice though). So, go into single user mode, and run fsck on the volume it was mad about, wait a while, and it should fix it. Sometimes you have to do this twice though (without rebooting, that is). I use ext3 now, and it gets rid of the fsck issues for me (very nice for when something happens to my power or something ).
quote:
Original post by Gabriel Fleseriu
Yes, my only desire is to be able to read the NTFS partition.


That makes it easier .

Share this post


Link to post
Share on other sites
quote:

Originally posted by Null and Void
So, to make sure I understand you: you went through the entire "make dep", "make modules", "make modules_install", "make bzImage", move the bzImage, and setup LILO/GRUB process, correct?



*ashamed* No, that is what I screwed up
I did a "make dep", thought that was all, and rebooted.
I assume I had to "make modules", "make modules_install", "make bzImage" after "make dep".

How do I "move the bzImage". What is bzImage, anyway?
And err... setup the LILO/GRUB? I use GRUB (that is the bootloader, isn''t it?)...I''m lost.

Oh, dear. I downloaded Linux, so I have no hard copy of the manual or whatever.

And for the "fsck": it keeps telling me that i did not provide the correct parameters...

Share this post


Link to post
Share on other sites
quote:
Original post by Gabriel Fleseriu
*ashamed* No, that is what I screwed up
I did a "make dep", thought that was all, and rebooted.
I assume I had to "make modules", "make modules_install", "make bzImage" after "make dep".

That shouldn''t have screwed anything up, it just didn''t create a new kernel. For instructions I gave a few days ago on building a new kernel, look here. No worries .
quote:
Original post by Gabriel Fleseriu
How do I "move the bzImage". What is bzImage, anyway?
And err... setup the LILO/GRUB? I use GRUB (that is the bootloader, isn''t it?)...I''m lost.

I explain the bzImage thing in the thread at the other end of that link. I''ve never used GRUB, so hopefully someone else will come up with some tips (or you could just look at the online docs).
quote:
Original post by Gabriel Fleseriu
Oh, dear. I downloaded Linux, so I have no hard copy of the manual or whatever.

At the command line you can type "man something" to get instructions on almost anything. I''ve never had any physical documentation for anything Linux either (the ''paid for'' distro''s I have are all from other people, cheapbytes, or something like that).

Share this post


Link to post
Share on other sites
Ok, thanks a lot. That will be helpfull as soon as I get home.

One more question: Could you point me to some links/resources that explain the basics of Linux? I do not mean things like "linux is a multi-user, multi-threaded os, blah, blah, case sensitive, blah, blah", but more things about the internal structure of the OS.
You know: Windows has WDMs, VXDs, DLLs, blah, blah - Linux has ??? made of ??? that interact ???. Maybe a Linux glossary?

TIA.

Forever trusting who we are
And nothing else matters
- Metallica

Share this post


Link to post
Share on other sites
Just a quick note: I dont know if anyone else had this problem,
but under redhat 7.2, I remade the kernel with NTFS support and
tried to install it using grub.

My conclusion is that I will not use grub ever again. =p

Under no circumstances, despite hours and hours of trawling newsgroups and trying different suggestions could I get grub to load the new kernel image, such that it would load my new modules.

On the bright side, using lilo was fairly easy (as always).

I eventually ended up reinstalling linux completly and formatting my msdos partition and making it vfat, simply because I so much trouble with NTFS.

So yeah. Have fun. You have my sympathy if you can''t make it work.

Share this post


Link to post
Share on other sites
Somehow, after two or three tries, it worked (thx, Null and Void ). My experience is that Linux has a hard time accessing the NTFS partition, i.e. when browsing the NTFS directory structure, it''s slow like hell.
Shadow Mint: I''m using GRUB. Just shamelessly replaced the kernel, and that was all.

Forever trusting who we are
And nothing else matters
- Metallica

Share this post


Link to post
Share on other sites
quote:
Original post by Gabriel Fleseriu
I''m using GRUB. Just shamelessly replaced the kernel, and that was all.

In the future, I would suggest at the very least renaming your old kernel in case of failure. Installing multiple kernels with GRUB is easy (you only need to modify one text file - and I''m speaking about nearly 2 years ago). Beats LILO any day.

(As usual, the opinions expressed within this post, particularly those concerning the fitness of particular bootloaders, are those of the individual poster''s in a member capacity, and do not constitute an official recommendation from GameDev.Net or its staff and moderators, or a suggestion of unsuitability of alternate products).

Share this post


Link to post
Share on other sites
Oluseyi: Thanks for the advice (about renaming the kernel). You know, I use Windows, so I always assume that something can go wrong So that was the first thing I''ve done.

Could someone do me the favor and save me a search over the net by recommanding me a good C++ IDE for Linux? Thanks.

Forever trusting who we are
And nothing else matters
- Metallica

Share this post


Link to post
Share on other sites
quote:
Original post by Gabriel Fleseriu
Could someone do me the favor and save me a search over the net by recommanding me a good C++ IDE for Linux? Thanks.

This has been discussed at one point in this forum. To sum it up: KDevelop and Anjuta are the big ones. You might want to try the ''old fashion'' way at one point though, you might just like it (I didn''t think I would, but I did ).

Share this post


Link to post
Share on other sites
Basically, he means the autoconf, Makefile, ./configure, etc., etc. way. It''s actually quite nice, and isn''t quite as awful as you may think.

rm -rf /bin/laden

Share this post


Link to post
Share on other sites
Actually, if you''re doing GUI stuff, you just use Glade or whatever to build the GUI, then you edit the code with those programs

rm -rf /bin/laden

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
more things about the internal structure of the OS.
You know: Windows has WDMs, VXDs, DLLs, blah, blah - Linux has ??? made of ??? that interact ???. Maybe a Linux glossary?
Okay, Linux works like this:

The whole darn thing is one connected piece of source code(one program, IOW) that is loaded at boot by Lilo or Grub. The bz in front of bzImage stands for the compression algorithm. It used to be called zImage because it used the gzip compression algorithm. Anyway, Lilo loads the uncompressed form into memory, then passes execution to it. The kernel then mounts the filesystem read only, so that it can get more information about how the system is configured.

Starting with the 2.0.x series, all Linux kernels are modular, so that unneeded modules can be deleted to save space in memory and on disk. The modules are .o, just like object files that haven''t been linked yet. In fact, they are pretty much just that.

Then, it loads all the modules it needs for the rest of the boot process. Then it reads which filesystems you want mounted, and mounts them. Filesystems work by specifying an integer for each file, called an inode. Each directory is really just a file listing all the names and inodes of the files in it(including other directories). An inode and the file it represents need not have a unique location. There''s a reference count that tracks when a file has no locations, however.

Then, it reloads the fs as read-write, and it runs a program called init, which runs the processes needed at bootup. In a directory called /etc/init.d, there are scripts that run each of these programs. IIRC(which I probably don''t), in directories called /etc/rc.x, which contain scripts needed by each runlevel. Runlevels are useful abstractions for how much work is being done by a system. A system in runlevel 2 is in single-user mode. Runlevel 3 is normal, console. Runlevel 5 is X-windows. /etc/inittab contains the default runlevel(in ASCII, so you can read and modify it). Runlevels 0 and 6 stand for shutdown and rebooting respectively. Init runs all the scripts up to and including those for the current runlevel. They are run in lexical order, so there''s usually a naming scheme to each script to make sure they run in the correct order.

Init eventually runs login, which allows you to enter your name and password. Login uses PAM, the arcitecture of which I don''t understand particularly well, just enough to use. Basically it''s a bunch of .so''s that you can use to set the level of security for each function. More on .so''s:

Larger programs use .so''s, which are Shared Object files(hence the suffix). Shared object files are essentially the same as the object files generated by a standard compiler. There''s no standard like COM to dictate how to use them. An annoyingly circular architecture is present here. A shared library called ld.so is called whenever dynamic linking is present in a program. It finds the references to libraries it knows about, and loads their code into memory, and replaces the references with addresses to the loaded copy.(there''s some caching here, and some reuse of code, too)

That should give you enough to google if you need more.

In answer to your original question, though, you could have just typed:
insmod /lib/modules/linux-<tab>/fs/ntfs.o

<tab> in bash finds and completes the filename. So basically, insmod /lib/modules/linux-2.4.17-1/fs/ntfs.o
or something like that is what it will look like.

I found a while ago that you''re not supposed to directly use insmod, there''s some program that''s better for that kind of thing. It will load a module and its dependencies, too. I can''t remember what it was called, though. Look for the previous thread on loading vfat(vfat can''t be loaded unless fat is present as well). Ntfs might also have some dependencies.

Share this post


Link to post
Share on other sites
quote:
I found a while ago that you're not supposed to directly use insmod, there's some program that's better for that kind of thing. It will load a module and its dependencies, too. I can't remember what it was called, though.

That would be 'modprobe'.
As an aside, if anybody is seriously interested in the internal workings of Linux, I would highly recommend the O'Reilly book Understanding the Linux Kernel .

[edited by - Martee on June 8, 2002 1:01:45 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Oluseyi
Glade is GNOME only...

I''m relatively sure Glade is merely GTK+ only, not Gnome only; but you are able to make Gnome only applications with it if you choose to. I think there''s a big difference .

Share this post


Link to post
Share on other sites
Thank you guys.

I have to confess that I still am a little bit confused. I reinstalled Linux, because it refused to see my internet connection any more, no matter what I did. I am still facing the problem that when Gnome starts up, it tells me that it "cannot resolve the internet address for My-Computer-Name". I tried to modify the etc/hosts file, but no luck. Any ideas?

Forever trusting who we are
And nothing else matters
- Metallica

Share this post


Link to post
Share on other sites
quote:
Original post by CmndrM
I''m sure there''s a Qt equivalent to Glade, anyway. Maybe KDevelop has that stuff built in?

There is a Qt equivalent to Glade, but it generally comes packaged with KDevelop (how most people seem to have found out about it). Which makes my point.

Share this post


Link to post
Share on other sites