All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bug fix for ntfs
@ 2012-04-23 14:41 Bean
  2012-04-23 15:04 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 15+ messages in thread
From: Bean @ 2012-04-23 14:41 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

Hi all,

This patch fix three issues:

1, In ntfsdoc, it says namespace = 0 means POSIX and it's case
sensitive. However, i found out this is not sure in Windows 7 as some
system directory use this value as well. Now i ignore this flag and
treat all files in ntfs as case insensitive.

2, Previous version doesn't return blocklist information for small
files embed in MFT, this patch fixes it. For example, create a
512-byte file test in ntfs and try this command:

grub-fstest /ntfs.img blocklist /test

3, Missing break in switch statement in grub-fstest

-- 
Best wishes
Bean

[-- Attachment #2: ntfs.txt --]
[-- Type: text/plain, Size: 4475 bytes --]

=== modified file 'grub-core/fs/ntfs.c'
--- grub-core/fs/ntfs.c	2012-02-27 20:36:58 +0000
+++ grub-core/fs/ntfs.c	2012-04-23 14:24:39 +0000
@@ -27,6 +27,7 @@
 #include <grub/fshelp.h>
 #include <grub/ntfs.h>
 #include <grub/charset.h>
+#include <grub/partition.h>
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
@@ -87,7 +88,8 @@
 }
 
 static grub_err_t read_mft (struct grub_ntfs_data *data, char *buf,
-			    grub_uint32_t mftno);
+			    grub_uint32_t mftno,
+			    grub_disk_addr_t *start_sector);
 static grub_err_t read_attr (struct grub_ntfs_attr *at, char *dest,
 			     grub_disk_addr_t ofs, grub_size_t len,
 			     int cached,
@@ -154,7 +156,7 @@
 	      else
 		{
 		  if (read_mft (at->mft->data, at->emft_buf,
-				u32at (at->attr_cur, 0x10)))
+				u32at (at->attr_cur, 0x10), NULL))
 		    return NULL;
 		}
 
@@ -398,7 +400,16 @@
     {
       if (ofs + len > u32at (pa, 0x10))
 	return grub_error (GRUB_ERR_BAD_FS, "read out of range");
-      grub_memcpy (dest, pa + u32at (pa, 0x14) + ofs, len);
+      pa += u32at (pa, 0x14) + ofs;
+      grub_memcpy (dest, pa, len);
+      if (read_hook)
+	{
+	  if ((pa >= at->mft->buf) && (pa < at->mft->buf + 512))
+	    read_hook (at->mft->sector, pa - at->mft->buf, len);
+	  else if ((pa >= at->mft->buf + 512) && (pa < at->mft->buf + 1024))
+	    read_hook (at->mft->sector + 1, pa - at->mft->buf - 512,
+		       len);
+	}
       return 0;
     }
 
@@ -537,11 +548,28 @@
 }
 
 static grub_err_t
-read_mft (struct grub_ntfs_data *data, char *buf, grub_uint32_t mftno)
+read_mft (struct grub_ntfs_data *data, char *buf, grub_uint32_t mftno,
+	  grub_disk_addr_t *start_sector)
 {
+  auto void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector,
+				   unsigned offset,
+				   unsigned length);
+  void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector,
+				   unsigned offset,
+				   unsigned length)
+  {
+    if (start_sector)
+      {
+	if ((offset != 0) || (length != GRUB_DISK_SECTOR_SIZE))
+	  grub_error (GRUB_ERR_BAD_FS, "invalid mft location");
+	*start_sector = sector;
+	start_sector = NULL;
+      }
+  }
+
   if (read_attr
       (&data->mmft.attr, buf, mftno * ((grub_disk_addr_t) data->mft_size << GRUB_NTFS_BLK_SHR),
-       data->mft_size << GRUB_NTFS_BLK_SHR, 0, 0))
+       data->mft_size << GRUB_NTFS_BLK_SHR, 0, read_hook))
     return grub_error (GRUB_ERR_BAD_FS, "read MFT 0x%X fails", mftno);
   return fixup (buf, data->mft_size, "FILE");
 }
@@ -557,7 +585,7 @@
   if (mft->buf == NULL)
     return grub_errno;
 
-  if (read_mft (mft->data, mft->buf, mftno))
+  if (read_mft (mft->data, mft->buf, mftno, &mft->sector))
     return grub_errno;
 
   flag = u16at (mft->buf, 0x16);
@@ -661,10 +689,8 @@
 
 	    *grub_utf16_to_utf8 ((grub_uint8_t *) ustr, tmp, ns) = '\0';
 	  }
-          if (namespace)
-            type |= GRUB_FSHELP_CASE_INSENSITIVE;
 
-	  if (hook (ustr, type, fdiro))
+	  if (hook (ustr, type | GRUB_FSHELP_CASE_INSENSITIVE, fdiro))
 	    {
 	      grub_free (ustr);
 	      return 1;
@@ -706,7 +732,7 @@
   if (mft->buf == NULL)
     return NULL;
 
-  if (read_mft (mft->data, mft->buf, mft->ino))
+  if (read_mft (mft->data, mft->buf, mft->ino, &mft->sector))
     return NULL;
 
   pa = locate_attr (&mft->attr, mft, GRUB_NTFS_AT_SYMLINK);
@@ -977,6 +1003,8 @@
   if (grub_disk_read
       (disk, data->mft_start, 0, data->mft_size << GRUB_NTFS_BLK_SHR, data->mmft.buf))
     goto fail;
+  data->mmft.sector = data->mft_start +
+    grub_partition_get_start (disk->partition);
 
   data->uuid = grub_le_to_cpu64 (bpb.num_serial);
 
@@ -1170,7 +1198,7 @@
       if (mft->buf == NULL)
 	goto fail;
 
-      if (read_mft (mft->data, mft->buf, mft->ino))
+      if (read_mft (mft->data, mft->buf, mft->ino, &mft->sector))
 	goto fail;
     }
 

=== modified file 'include/grub/ntfs.h'
--- include/grub/ntfs.h	2012-01-20 14:01:35 +0000
+++ include/grub/ntfs.h	2012-04-23 13:58:26 +0000
@@ -146,6 +146,7 @@
   grub_uint64_t mtime;
   grub_uint32_t ino;
   int inode_read;
+  grub_disk_addr_t sector;
   struct grub_ntfs_attr attr;
 };
 

=== modified file 'util/grub-fstest.c'
--- util/grub-fstest.c	2012-03-08 18:09:05 +0000
+++ util/grub-fstest.c	2012-04-23 13:30:34 +0000
@@ -389,9 +389,11 @@
     case CMD_BLOCKLIST:
       execute_command ("blocklist", n, args);
       grub_printf ("\n");
+      break;
     case CMD_TESTLOAD:
       execute_command ("testload", n, args);
       grub_printf ("\n");
+      break;
     case CMD_XNU_UUID:
       {
 	grub_device_t dev;


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 14:41 [PATCH] bug fix for ntfs Bean
@ 2012-04-23 15:04 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-04-23 15:26   ` Bean
  0 siblings, 1 reply; 15+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-23 15:04 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1842 bytes --]

On 23.04.2012 16:41, Bean wrote:
> Hi all,
>
> This patch fix three issues:
>
> 1, In ntfsdoc, it says namespace = 0 means POSIX and it's case
> sensitive. However, i found out this is not sure in Windows 7 as some
> system directory use this value as well. Now i ignore this flag and
> treat all files in ntfs as case insensitive.
This would be wrong. It's certаinly possible to create files differing
only in case in POSIX namespace, so it's case-sensitive. If some system
directory uses this namespace it's case-sensitive
> 2, Previous version doesn't return blocklist information for small
> files embed in MFT, this patch fixes it. For example, create a
> 512-byte file test in ntfs and try this command:
>
> grub-fstest /ntfs.img blocklist /test
It looks like this part of patch has issues. Like that it doesn't handle
the case when the read is split across 2 sectors or if MFT entry is at
offset >=1024. Or that it adds some checks (like "invalid mft offset")
which weren't there previously and which would make GRUB bail out on
weird FS even if user doesn't want blocklists.
AFAIR MFT is duplicated and so we can't just overwrite it, also MFT can
more easily change place. In such cases we intentionally skip the
blocklists (like we do for ZFS and BtrFS). In any case I feel like this
part shouldn't go it until after 2.00 as it doesn't fix any end-user
problem (blocklists for embed files would be rejected by any of
blocklist users, other than blocklist command) and it may cause new
problems.
> 3, Missing break in switch statement in grub-fstest
Will commit this part shortly.
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 15:04 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-04-23 15:26   ` Bean
  2012-04-23 15:41     ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 15+ messages in thread
From: Bean @ 2012-04-23 15:26 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

2012/4/23 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> On 23.04.2012 16:41, Bean wrote:
>> Hi all,
>>
>> This patch fix three issues:
>>
>> 1, In ntfsdoc, it says namespace = 0 means POSIX and it's case
>> sensitive. However, i found out this is not sure in Windows 7 as some
>> system directory use this value as well. Now i ignore this flag and
>> treat all files in ntfs as case insensitive.
> This would be wrong. It's certаinly possible to create files differing
> only in case in POSIX namespace, so it's case-sensitive. If some system
> directory uses this namespace it's case-sensitive

Do you know any tool that can create case sensitive file in ntfs ?
ntfsdoc is not official so it can get it wrong, or MS may change the
meaning of some flags. At least I can't create file in different case
as those directories so this should mean it's case insensitive.

>> 2, Previous version doesn't return blocklist information for small
>> files embed in MFT, this patch fixes it. For example, create a
>> 512-byte file test in ntfs and try this command:
>>
>> grub-fstest /ntfs.img blocklist /test
> It looks like this part of patch has issues. Like that it doesn't handle
> the case when the read is split across 2 sectors or if MFT entry is at
> offset >=1024. Or that it adds some checks (like "invalid mft offset")
> which weren't there previously and which would make GRUB bail out on
> weird FS even if user doesn't want blocklists.

MFT in ntfs is only 1024 bytes, and it must be sector aligned, so if
this test fails, there is serious problem with the fs (or the driver).

> AFAIR MFT is duplicated and so we can't just overwrite it, also MFT can
> more easily change place. In such cases we intentionally skip the
> blocklists (like we do for ZFS and BtrFS). In any case I feel like this
> part shouldn't go it until after 2.00 as it doesn't fix any end-user
> problem (blocklists for embed files would be rejected by any of
> blocklist users, other than blocklist command) and it may cause new
> problems.
no problem.

-- 
Best wishes
Bean


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 15:26   ` Bean
@ 2012-04-23 15:41     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-04-23 16:03       ` Bean
  0 siblings, 1 reply; 15+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-23 15:41 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2332 bytes --]

On 23.04.2012 17:26, Bean wrote:
> Hi,
>
> 2012/4/23 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> On 23.04.2012 16:41, Bean wrote:
>>> Hi all,
>>>
>>> This patch fix three issues:
>>>
>>> 1, In ntfsdoc, it says namespace = 0 means POSIX and it's case
>>> sensitive. However, i found out this is not sure in Windows 7 as some
>>> system directory use this value as well. Now i ignore this flag and
>>> treat all files in ntfs as case insensitive.
>> This would be wrong. It's certаinly possible to create files differing
>> only in case in POSIX namespace, so it's case-sensitive. If some system
>> directory uses this namespace it's case-sensitive
> Do you know any tool that can create case sensitive file in ntfs ?
> ntfsdoc is not official so it can get it wrong, or MS may change the
> meaning of some flags. At least I can't create file in different case
> as those directories so this should mean it's case insensitive.
Have you tried with ntfs-3g?
Also if the problem is with only one directory, it's better if it stays
the way it is. The only quirk associated with false assumption about
case-sensitivity is the need to reference the name in correct case which
should be done anyway. If you wrongly assume case insensitivity some
files may become inaccessible with is more serious.
OS may forbid some file names without it being FS limitation (conversely
OS may fail to enforce FS limitation like an old trick with ".." in the
root directory)

>>> 2, Previous version doesn't return blocklist information for small
>>> files embed in MFT, this patch fixes it. For example, create a
>>> 512-byte file test in ntfs and try this command:
>>>
>>> grub-fstest /ntfs.img blocklist /test
>> It looks like this part of patch has issues. Like that it doesn't handle
>> the case when the read is split across 2 sectors or if MFT entry is at
>> offset >=1024. Or that it adds some checks (like "invalid mft offset")
>> which weren't there previously and which would make GRUB bail out on
>> weird FS even if user doesn't want blocklists.
> MFT in ntfs is only 1024 bytes, and it must be sector aligned, so if
> this test fails, there is serious problem with the fs (or the driver).
Is it true for 4K sector NTFS?

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 15:41     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-04-23 16:03       ` Bean
  2012-04-23 16:29         ` Bean
                           ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Bean @ 2012-04-23 16:03 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

2012/4/23 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> Have you tried with ntfs-3g?
> Also if the problem is with only one directory, it's better if it stays
> the way it is. The only quirk associated with false assumption about
> case-sensitivity is the need to reference the name in correct case which
> should be done anyway. If you wrongly assume case insensitivity some
> files may become inaccessible with is more serious.
> OS may forbid some file names without it being FS limitation (conversely
> OS may fail to enforce FS limitation like an old trick with ".." in the
> root directory)
>

I did some testing and found more serious issue, it seems directories
like Windows, Users has disappeared. I need more testing to find the
problem.

>>>> 2, Previous version doesn't return blocklist information for small
>>>> files embed in MFT, this patch fixes it. For example, create a
>>>> 512-byte file test in ntfs and try this command:
>>>>
>>>> grub-fstest /ntfs.img blocklist /test
>>> It looks like this part of patch has issues. Like that it doesn't handle
>>> the case when the read is split across 2 sectors or if MFT entry is at
>>> offset >=1024. Or that it adds some checks (like "invalid mft offset")
>>> which weren't there previously and which would make GRUB bail out on
>>> weird FS even if user doesn't want blocklists.
>> MFT in ntfs is only 1024 bytes, and it must be sector aligned, so if
>> this test fails, there is serious problem with the fs (or the driver).
> Is it true for 4K sector NTFS?

Yeah, I've tried 64K block size and MFT is still 1024 bytes, it just
pack multiple MFT in a single allocation unit.

-- 
Best wishes
Bean


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 16:03       ` Bean
@ 2012-04-23 16:29         ` Bean
  2012-04-23 16:31         ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-04-24 15:36         ` Thomas Frauendorfer
  2 siblings, 0 replies; 15+ messages in thread
From: Bean @ 2012-04-23 16:29 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

2012/4/24 Bean <bean123ch@gmail.com>:
> Hi,
>
> 2012/4/23 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> Have you tried with ntfs-3g?
>> Also if the problem is with only one directory, it's better if it stays
>> the way it is. The only quirk associated with false assumption about
>> case-sensitivity is the need to reference the name in correct case which
>> should be done anyway. If you wrongly assume case insensitivity some
>> files may become inaccessible with is more serious.
>> OS may forbid some file names without it being FS limitation (conversely
>> OS may fail to enforce FS limitation like an old trick with ".." in the
>> root directory)
>>
>
> I did some testing and found more serious issue, it seems directories
> like Windows, Users has disappeared. I need more testing to find the
> problem.

Oh sorry, i forgot that windows 7 stores boot files in a separate
partition. It seems almost all files windows 7 created during
installation uses this settings (all files and directories in
/Windows, /Users, etc)

-- 
Best wishes
Bean


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 16:03       ` Bean
  2012-04-23 16:29         ` Bean
@ 2012-04-23 16:31         ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-04-23 16:54           ` Bean
  2012-04-24 15:36         ` Thomas Frauendorfer
  2 siblings, 1 reply; 15+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-23 16:31 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]

On 23.04.2012 18:03, Bean wrote:
> Hi,
>
> 2012/4/23 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> Have you tried with ntfs-3g?
>> Also if the problem is with only one directory, it's better if it stays
>> the way it is. The only quirk associated with false assumption about
>> case-sensitivity is the need to reference the name in correct case which
>> should be done anyway. If you wrongly assume case insensitivity some
>> files may become inaccessible with is more serious.
>> OS may forbid some file names without it being FS limitation (conversely
>> OS may fail to enforce FS limitation like an old trick with ".." in the
>> root directory)
>>
> I did some testing and found more serious issue, it seems directories
> like Windows, Users has disappeared. I need more testing to find the
> problem.
"disappeared" as in "no longer visible in GRUB"? Do you have a way to
recreate. If so we could add it to (unreleased) FS tests.

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 16:31         ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-04-23 16:54           ` Bean
  2012-04-23 17:00             ` Bean
  2012-04-23 20:02               ` jeff
  0 siblings, 2 replies; 15+ messages in thread
From: Bean @ 2012-04-23 16:54 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

2012/4/24 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> On 23.04.2012 18:03, Bean wrote:
>> Hi,
>>
>> 2012/4/23 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>> Have you tried with ntfs-3g?
>>> Also if the problem is with only one directory, it's better if it stays
>>> the way it is. The only quirk associated with false assumption about
>>> case-sensitivity is the need to reference the name in correct case which
>>> should be done anyway. If you wrongly assume case insensitivity some
>>> files may become inaccessible with is more serious.
>>> OS may forbid some file names without it being FS limitation (conversely
>>> OS may fail to enforce FS limitation like an old trick with ".." in the
>>> root directory)
>>>
>> I did some testing and found more serious issue, it seems directories
>> like Windows, Users has disappeared. I need more testing to find the
>> problem.
> "disappeared" as in "no longer visible in GRUB"? Do you have a way to
> recreate. If so we could add it to (unreleased) FS tests.

Actually there is no problem. Windows 7 stores boot files in one
partition and system files in another, so you won't find Windows
directory in the boot partition. I constantly forget about it.

BTW, I think i understand how this flag works. If the file is
installed by Windows and not writable, it has a TrustedInstaller
security descriptor and namespace is set  to 0, for example
C:\Windows\notepad.exe. If the file is modified, there is no
TrustedInstaller descriptor and namespace is set to 1, such as
C:\Windows\win.ini. It seems this flag is not used for unix namespace
anymore.

-- 
Best wishes
Bean


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 16:54           ` Bean
@ 2012-04-23 17:00             ` Bean
  2012-04-23 20:02               ` jeff
  1 sibling, 0 replies; 15+ messages in thread
From: Bean @ 2012-04-23 17:00 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

2012/4/24 Bean <bean123ch@gmail.com>:
> BTW, I think i understand how this flag works. If the file is
> installed by Windows and not writable, it has a TrustedInstaller
> security descriptor and namespace is set  to 0, for example
> C:\Windows\notepad.exe. If the file is modified, there is no
> TrustedInstaller descriptor and namespace is set to 1, such as
> C:\Windows\win.ini. It seems this flag is not used for unix namespace
> anymore.

Oh, C:\Windows\notepad.exe also set namespace = 0, but files created
after installation set namespace = 1, like
C:\Windows\WindowsUpdate.log

-- 
Best wishes
Bean


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
@ 2012-04-23 20:02               ` jeff
  0 siblings, 0 replies; 15+ messages in thread
From: Jeffrey Sheinberg @ 2012-04-23 20:02 UTC (permalink / raw)
  To: The development of GNU GRUB

On Tue, Apr 24, 2012 at 12:54:03AM +0800, Bean wrote:

> Actually there is no problem. Windows 7 stores boot files in one
> partition and system files in another, so you won't find Windows
> directory in the boot partition. I constantly forget about it.
 
One cannot assume that the Windows 7 bootmgr files are stored on a
partition that is different from the Windows 7 system files.

If there is no existing primary partition on the boot drive that
contains the bootmgr files, and if the installer is directed to install
to an existing primary partition on that same boot drive, then the
bootmgr files and the system files will both be installed to that
existing partition.

-- 
Jeffrey Sheinberg



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
@ 2012-04-23 20:02               ` jeff
  0 siblings, 0 replies; 15+ messages in thread
From: jeff @ 2012-04-23 20:02 UTC (permalink / raw)
  To: The development of GNU GRUB

On Tue, Apr 24, 2012 at 12:54:03AM +0800, Bean wrote:

> Actually there is no problem. Windows 7 stores boot files in one
> partition and system files in another, so you won't find Windows
> directory in the boot partition. I constantly forget about it.
 
One cannot assume that the Windows 7 bootmgr files are stored on a
partition that is different from the Windows 7 system files.

If there is no existing primary partition on the boot drive that
contains the bootmgr files, and if the installer is directed to install
to an existing primary partition on that same boot drive, then the
bootmgr files and the system files will both be installed to that
existing partition.

-- 
Jeffrey Sheinberg



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-23 16:03       ` Bean
  2012-04-23 16:29         ` Bean
  2012-04-23 16:31         ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-04-24 15:36         ` Thomas Frauendorfer
  2012-04-25  3:01           ` Bean
  2 siblings, 1 reply; 15+ messages in thread
From: Thomas Frauendorfer @ 2012-04-24 15:36 UTC (permalink / raw)
  To: The development of GNU GRUB

On Mon, Apr 23, 2012 at 6:03 PM, Bean <bean123ch@gmail.com> wrote:
> Hi,
>
>>>>> 2, Previous version doesn't return blocklist information for small
>>>>> files embed in MFT, this patch fixes it. For example, create a
>>>>> 512-byte file test in ntfs and try this command:
>>>>>
>>>>> grub-fstest /ntfs.img blocklist /test
>>>> It looks like this part of patch has issues. Like that it doesn't handle
>>>> the case when the read is split across 2 sectors or if MFT entry is at
>>>> offset >=1024. Or that it adds some checks (like "invalid mft offset")
>>>> which weren't there previously and which would make GRUB bail out on
>>>> weird FS even if user doesn't want blocklists.
>>> MFT in ntfs is only 1024 bytes, and it must be sector aligned, so if
>>> this test fails, there is serious problem with the fs (or the driver).
>> Is it true for 4K sector NTFS?
>
> Yeah, I've tried 64K block size and MFT is still 1024 bytes, it just
> pack multiple MFT in a single allocation unit.

When I formated a disk with 4K sectors in Windows it used a complete
sector for each MFT record. The block size is not relevant for the MFT
record size, but the sector size of the disk is.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-24 15:36         ` Thomas Frauendorfer
@ 2012-04-25  3:01           ` Bean
  2012-04-25  6:11             ` Thomas Frauendorfer
  0 siblings, 1 reply; 15+ messages in thread
From: Bean @ 2012-04-25  3:01 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

On Tue, Apr 24, 2012 at 11:36 PM, Thomas Frauendorfer
<thomas.frauendorfer@googlemail.com> wrote:
> When I formated a disk with 4K sectors in Windows it used a complete
> sector for each MFT record. The block size is not relevant for the MFT
> record size, but the sector size of the disk is.

Thanks for the info, I don't have any 4K drive to test. You can check
if ntfs fs driver is working properly since I don't remember if I have
made the 1024 MFT assumption elsewhere.

-- 
Best wishes
Bean


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-25  3:01           ` Bean
@ 2012-04-25  6:11             ` Thomas Frauendorfer
  2012-04-25  8:34               ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Frauendorfer @ 2012-04-25  6:11 UTC (permalink / raw)
  To: The development of GNU GRUB

On Wed, Apr 25, 2012 at 5:01 AM, Bean <bean123ch@gmail.com> wrote:
> Thanks for the info, I don't have any 4K drive to test. You can check
> if ntfs fs driver is working properly since I don't remember if I have
> made the 1024 MFT assumption elsewhere.

I don't know yet when I will have the time to test it because the 4k
drives are test hardware at work.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] bug fix for ntfs
  2012-04-25  6:11             ` Thomas Frauendorfer
@ 2012-04-25  8:34               ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 15+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-25  8:34 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1505 bytes --]

On 25.04.2012 08:11, Thomas Frauendorfer wrote:
> On Wed, Apr 25, 2012 at 5:01 AM, Bean <bean123ch@gmail.com> wrote:
>> Thanks for the info, I don't have any 4K drive to test. You can check
>> if ntfs fs driver is working properly since I don't remember if I have
>> made the 1024 MFT assumption elsewhere.
> I don't know yet when I will have the time to test it because the 4k
> drives are test hardware at work.
man mkfs.ntfs:
       -s, --sector-size BYTES
              Specify  the  size of sectors in bytes. Valid sector size
values
              are 256, 512, 1024, 2048 and 4096 bytes per sector. If 
omitted,
              mkntfs  attempts  to determine the sector-size
automatically and
              if that fails a default of 512 bytes per sector is used.
modinfo scsi_debug:
parm:           sector_size:logical block size in bytes (def=512) (int)

revno: 3759
committer: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
branch nick: grub
timestamp: Fri 2012-01-20 15:01:35 +0100
message:
        Support 4K-sector NTFS.
 
        * include/grub/ntfs.h (GRUB_NTFS_MAX_MFT): Increase to 8.
        (grub_ntfs_data): Remove blocksize.
        * grub-core/fs/ntfs.c (fixup): Fix size comparison.
        Remove data argument. All users updated.

> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-04-25 15:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-23 14:41 [PATCH] bug fix for ntfs Bean
2012-04-23 15:04 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-23 15:26   ` Bean
2012-04-23 15:41     ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-23 16:03       ` Bean
2012-04-23 16:29         ` Bean
2012-04-23 16:31         ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-23 16:54           ` Bean
2012-04-23 17:00             ` Bean
2012-04-23 20:02             ` Jeffrey Sheinberg
2012-04-23 20:02               ` jeff
2012-04-24 15:36         ` Thomas Frauendorfer
2012-04-25  3:01           ` Bean
2012-04-25  6:11             ` Thomas Frauendorfer
2012-04-25  8:34               ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.