Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

writing to NTFS

  Date: Dec 11    Category: Unix / Linux / Ubuntu    Views: 441
  

I saved a file I'd created in Open Office in Ubuntu to the Windows
drive on my dual-boot system. One HD has XP and the other Ubuntu, and grub is in
boot record of the primary, Windows drive. I absent-mindedly saved the filename
with quotation marks in it. Upon rebooting this morning, in Windows, I tried to
access the file and couldn't; when I attempted to rename it an error occurred
that XP was unable to swallow, requiring me to shut the computer off via the
power switch.

The grub menu showed but Ubuntu would not boot, and I had to shut down again
with the power switch and make a cycle through recovery mode during which the
system checked my ext3 partition. Then I could reboot in Ubuntu, rename the file
on the other HD to a name without the quote marks, return to Windows and access
the file as I'd originally intended.

I remember blue-screen death and other hopeless freezups under W98 but this is
the first time something so radical ever happened to me under XP. OK, lesson
learned about the quote marks. But:

One: why might Ubuntu have refused to boot? Refused to do nuthin after the grub
menu -- zilch, blank screen and no disk activity, until I recovered which
included running the requisite disk test.

Two: I've heard it said it's better not to use Linux to write to an NTFS
partition, but sometimes I need to do so. I didn't install any special
utilities. Aside from being careful with file names is there anything else I
need to watch out for? Do I need a utility?

Share: 

 

5 Answers Found

 
Answer #1    Answered On: Dec 11    

One: why might Ubuntu have refused to boot? Refused to do nuthin after
the grub menu -- zilch, blank screen and no disk activity, until I
recovered which included running the requisite disk test.

Two: I've heard it said it's better not to use Linux to write to an
NTFS partition, but sometimes I need to do so. I didn't install any
special utilities. Aside from being careful with file names is there
anything else I need to watch out for? Do I need a utility?

 
Answer #2    Answered On: Dec 11    

hat a great explanation. Clarifies a lot,
but I got a few questions that don't matter to the running
of my system but I'd like to understand what happens.

 
Answer #3    Answered On: Dec 11    

If you must dual boot, why not use a USB thumb drive to transfer
files?

I play action games on Saundra's XP machine, otherwise I use my Ubuntu box. When
I made up my mind to find a better OS, that is what I did. Sure I dual booted
for a month while learning what I needed to know in Ubuntu. I just can't see
infecting a good box with the virus called MS. After all if I was unhappy
enough, to be willing to learn a new system, I must not have liked what I had.

Save to flash and save your

 
Answer #4    Answered On: Dec 11    

Why would the permissions bit matter? I assume Linux does not
attempt to set permission bits on a file it writes to NTFS.
It makes sense for it to write that file in a format that
NTFS and Windows recognizes as its own, right? Here may be
an opportunity for me to nail down something I've been
wondering for a while.

It matters in the sense that it is preferred to have permissions set at the
root level for some things and at the user level for others. Windows does not
differentiate. Everything is at the user level and it does not distinguish
between users. When a file is written to NTFS it uses the protocols for Windows,
not Linux. So you lose the control that Linux gives. Anyone who logs onto
Windows can then access your files. In Linux this is not the case. Only the user
can modify his own files and only root can modify things at that level. So by
saving to Windows you are losing some control over your data.

A Windows user is typically not concerned, but a Linux user takes permissions
seriously.

As I understood, the permissions bits are in the file's header
at or very near the beginning of the file. They have nothing
to do with the content of the file as used by an application
program -- that is, if I write a plain-text or MP3 file to
my Linux ext3 volume, its file header including file name and
various other information will be written in the Linux way,
the ext3 way. But if I write the same file to an NTFS volume
under Windows, the header will be as Windows writes it.
The file under Linux will have permission bits as part of the
information stored in the header; the Windows file won't.
So, when Linux writes to the NTSF side,

You are right. Linux uses Windows protocols for writing to NTFS.


I assume from your tone the occasional file here or there does
not cause things to get out of whack. Yet the attempt to
rename one file in Windows that had been written by Linux with
double quotation marks caused me half an hour of repair time.
I won't make that mistake again but Linux should not have
allowed me to write that file to the NTFS volume. Linux and
me, we done broke the rules and I deserved to be punished; it
wasn't Windows' fault. Well, it wasn't Linux's fault either
because I asked it to break Windows's rules.

Yes, you discovered one of the hidden dangers. Linux has its own naming
structure and with very few exceptions you can type most characters, except file
naming ones such as slashes, ? and *, plus the names can be much longer and
don't require a suffix. From Linux's point of view the file name was okay to
save it this way. It is not assuming that you will open it where it will cause
problems. In other words, you could be using the NTFS to open from as well.
Perhaps they should be assuming the worst, but Linux tends to err on the side of
flexibility, placing the burden on the user.

If you save a text file for example you might assume that it will append .txt,
but Linux doesn't. So for Windows to read the file you will have to follow
Windows naming conventions in Linux.

ECC: see no reason for the crash on the Windows
side to have affected my Linux boot process. It was for
this reason I bought another drive to run Linux; and the
only thing that has changed on that first drive is grub
in its boot sector. The grub menu showed but would not
launch Linux except in recovery mode.

Roy: It did not likely affect the boot process. Disk checking is built into the
boot process and mostly it blithely continues on its way, but when necessary it
will stop and check the drives. Somehow the hard boot caused the drive that
Ubuntu was on the have some consistency error or at least was set to check it,
probably because the BIOS kicked in to indicate a hard boot. Ubuntu wanted to
make sure that the drive was okay after the BIOS informed it of possible
problems before it would remount it.

I don't know exactly what happened, but whatever it was, your system got a jolt.


ECC: OK, but why would my hd1 (sdb) drive, which as far as
I can understand was not being used while I was using
Windows, have suffered? The following all makes sense:


Roy: Your drives constantly spin. This is less hard on them than turning them on
and off. You may be confusing read/ write activity (flashing LED) with spinning.
No flashing light does not mean no activity.


ECC: How is this done? I understand roughly what the POST
check is, and beeps it can generate if something is
wrong, but I never heard of checking drives for anything.

Roy: POST stands for power on self test. The drives are only one part of POST.
All devices are checked and catalogued so that this info can be passed on the
the operating system. The BIOS detects whether it has been a warm or cold boot
and distinguishes between them. On a cold boot it does more than on a warm boot.
Possible errors are passed on the operating system. This is why you get the menu
in Windows offering to boot into Safe Mode and probably why Linux had to check
your drive. It did not mean that anything was actually wrong. Since it wasn't
writing data to your drive it probably meant that the drive was okay, but the
operating system is built to take no chances and offers at minimum to check the
drive.


ECC: But when it does that I get a message immediately after
grub launches Ubuntu, and a number showing what percentage
has been checked.

Reply: There are times when you have a choice and times when you have no choice.
Sometimes when you aren't given a choice you don't see the message for awhile
giving you the impression that something is wrong when it is just checking the
disk and taking its time advising you. I generally prefer to boot in text mode;
it gives you more info.

I don't want to give the impression that I am a harware specialist. There are
plenty of things that I don't know. Mostly, because I choose to spend my time
with other concerns.

 
Answer #5    Answered On: Dec 11    

I write to ntfs all the time from Xubuntu on my laptop which is in Wubi file on
the XP disk, 8.04 never had a problem.

The lock up may have occurred because XP wrote something to the disk which
locked it up. (suggest run scandsk to clear)

 
Didn't find what you were looking for? Find more on writing to NTFS Or get search suggestion and latest updates.




Tagged: