C H P T E R 7 Windows Vista Windows Vista Windows VistaFT16 FT32NTFS NTFSNew Technology File System NTFS
247 6 7-1 Windows VistaTransactional NTFS TxFTxF Windows Vista MicrosoftTxF CIDatomicity - Consistency - Isolation - Durability - CID C#TxF using System; using System.Runtime.InteropServices; using System.IO; namespace TxF { class Program { [DllImport("Kernel32.dll")] static extern bool
DeleteFileTransactedW([Marshals(UnmanagedType.LPWStr)]string file, IntPtr transaction); 6 [DllImport("Kernel32.dll")] static extern bool CloseHandle(IntPtr handle); [DllImport("Ktmw32.dll")] static extern bool CommitTransaction (IntPtr transaction); [DllImport("Ktmw32.dll")] static extern bool RollbackTransaction (IntPtr transaction); [DllImport("Ktmw32.dll")] s t a t i c e x t e r n I n t P t r C r e a t e T r a n s a c t i o n(i n t P t r s e c u r i t y t t r i b u t e s, I n t P t r g u i d, i n t o p t i o n s, i n t isolationlevel, int isolationflags, int milliseconds, string description); static void Main(string[] args) { // // Demo setup. // string file1 = "c:\\temp\\txf1.txt"; string file2 = "c:\\temp\\txf2.txt"; using (StreamWriter sw = File.CreateText(file1)) sw.writeline("hello World"); using (StreamWriter sw = File.CreateText(file2)) sw.writeline("hello World"); // // Start the demo. // 257.1
267 6 Console.WriteLine("Press <ENTER> to start the transaction."); Console.ReadLine(); // // Create a kernel transaction. // IntPtr tx = CreateTransaction(IntPtr.Zero, IntPtr.Zero, 0, 0, 0, 0, null); // // Delete the files (transacted). // bool rollback = false; if (!DeleteFileTransactedW(file1, tx)) rollback = true; if (!DeleteFileTransactedW(file2, tx)) rollback = true; // // Commit or rollback? // if (!rollback) { char c; do { Console.WriteLine("{0} {1}.", file1, File.Exists(file1)? "still exists" : "has vanished"); Console.WriteLine("{0} {1}.", file2, File.Exists(file2)? "still exists" : "has vanished"); Console.Write("Commit transaction (Y/N)? "); c = (char)console.read(); }
while (c!= 'Y' && c!= 'y' && c!= 'N' && c!= 'n'); 6 if (c == 'Y' c == 'y') CommitTransaction(tx); else RollbackTransaction(tx); } else { Console.WriteLine("Forced rollback!"); RollbackTransaction(tx); } // // Close kernel mode transaction handle. // CloseHandle(tx); } } } C:\Temptxf1. txttxf2.txt rollback 277.1
27 6 TxF1 Step1 TxF.exe Step2 Dir c:\temptxf1.txttxf2.txt Step3 TxF.exeENTER Step4 Dir c:\temptxf1.txttxf2.txt Step5TxF.exe Y Step6c:\temptxf1.txttxf2.txt Step1~5 Step1~5 TxF2 Step1 TxF.exe Step2 Dir c:\temptxf1.txttxf2.txt Step3 TxF.exeENTER Step4 Dir c:\temptxf1.txttxf2.txt Step5 TxF.exeNrollback Step6 c:\temptxf1.txttxf2.txt TxFWindows Vista Windows Vista
7-2 6 Windows VistaFT16FT32 NTFSCDFSUDF FT16 PCFT32Windows Windows Me FT WindowsNTFS FT 7-1FT16FT32NTFS Criteria NTFS5 NTFS FT32 FT16 FT12 Windows Windows DOS v7 DOS DOS 2000 NT and higher Windows XP Windows 2000 Windows ll versions of Microsoft Windows ll versions of Microsoft Windows Windows Windows Windows Server XP ME 2003 Windows Windows Windows Vista Server 2003 2000 Windows Vista Windows XP 7-1FT16FT32NTFS 27.2
3007 6 Criteria NTFS5 NTFS FT32 FT16 FT12 :16EB SIZE Max Clusters Number w/ 64KB 32GB for 2GB for all Clusters all OS. OS. / 16TB w/ 4KB Clusters 2TB 16MB : 2TB/ 2TB for 4GB for 256TB some OS some OS (>2TB ) Nearly Nearly 414304 65536 Unlimited Unlimited Limit Only Limit Only 2GB 16MB by by 4GB minus (Limit Only (Limit Only 2 Bytes by Volume by Volume Volume Volume Size) Size) Size Size Nearly Nearly Unlimited Unlimited 41771 65520 400 Standard -.3 Up to 255 Up to 255 Up to 255 Up to 254 Extended - up to 255 7-1FT16FT32NTFS
Criteria NTFS5 NTFS FT32 FT16 FT12 Unicode Unicode Character Set Unicode Character Set System Character Set System Character Set System Character Set System Records Mirror MFT Mirror File MFT Mirror File Second Copy of FT Second Copy of FT Second Copy of FT First First First Sector First First and Last and Last and Copy Sector Sector Sectors Sectors in Sector #6 Standard and Standard and Standard Set Standard Set Standard Set Custom Custom Yes Yes No No No Yes Yes No No No Yes No No No No DESX Yes No No No No 3DES Yes No No No No ES Yes No No No No Yes Yes No No No Yes No No No No Sparse Files Yes No No No No Reparse Points Yes No No No No Volume Mount Yes No No No No Points Volume Shadow Yes No No No No Services POSIX Yes Yes No No No 7-1FT16FT32NTFS 6 3017.2
3027 6 Criteria NTFS5 NTFS FT32 FT16 FT12 Yes Yes No No No Yes Yes No No No Low on small volumes Low on small volumes High on small volumes Highest on small volumes High High on Large High on Large Low on large Low on large Disk Space Economy Max Max verage Minimal on large Max volumes Max Max Minimal verage verage 7-1FT16FT32NTFS 7-1 NTFS CDFSUDFCD-ROMDVDWindows Vista UDF Read and Write V2.50V2.01V1.50V1.02 Read-only V2.6 Default to UDF 2.01 for DVD/CDR/RW Default to UDF 2.50 for HD DVD/BD
7-2-1 NTFS NTFNew Technology File SystemWindows Vista MicrosoftWindows NT Windows VistaWindows XPNTFS NTFS 5.0Windows Vista NTFS File & Local security c c e s s C o n t ro l List Volume Volume Extended NTFS Compression Transaction Logging Bad-cluster Remapping R e c o v e r a b i l i t y Reliability POSIX case-sensitive Hard LinksPOSIX 16TB B-Tree EFS Disk Quotas Disk Defragmentation Fragmentation 7-2Windows Vista NTFS 6 3037.2
3047 6 7-2-2 FTNTFS Windows VistaNTFSWindows VistaCONVERT.EXEFT NTFSFT16FT32NTFS FTFT32 CONVERT.EXENTFS FTFT32CONVERT.EXE C o n v e r t v o l u m e: /F S:N T F S [/V] [/C v t r e a:f i l e n a m e] [/ NoSecurity] [/X] volume NTFS /FS:NTFS /V /Cvtrea:filename NTFS /NoSecurity /X Convert c: /fs:ntfsc NTFS 7-3 NTFS NTFS Windows Vista Windows
Vista Windows Vista NTFS NTFSStandard Permission Special Permission 7-3-1 7-3 7-4 NTFS 1 Read Write List Folder Contents Transverse Directory Read & Execute Modify Full Control 1Read-OnlyHiddenrchive System 2 7-3NTFS 6 7.3 NTFS305
3067 6 NTFS NTFS Read Write Read & Execute Modify Full Control 7-4NTFS 7-3-2 NTFS Windows VistaNTFS NTFS NTFS Step1 Step2 (C:)C:\ Report1 Step3 C : \ R e p o r t 1 Report17-1
3076 7-1NTFS Step4 Report1 Step5 7-2 7-3 jackmelvinleu 7-2 7.3 NTFS
307 6 7-3 Step6 C:\Report1 Step5 R e p o r t1
306 7-4 7-3-3 Windows Vista NTFS NTFS Windows Vista 13 7.3 NTFS
3107 6 / // 13 Everyone NTFS 7-513
311 NTFS // // dministrators 7-513 7-6 6 7.3 NTFS
3127 6 Traverse Folder/Execute File / List Folder/Read Data Read ttributes Read Extended ttributes / Create Files/Write Data / Create Folders/ppend Data Write ttributes Write Extended ttributes Delete Subfolders and Files Delete Read Permissions Change Permissions Take Ownership 1[] 2 7-6 /
7-3-4 NTFS Step1 Step2 (C:)C:\ Report1 Step3 C:\Report1Report1 Report1 7-5 6 7.3 NTFS313
3147 6 NTFS Step1 jack Report1 Step2 R e p o r t1 NTFS 7-6jackNTFS ndyntfs3 Report1 ndy Report1 ndy ndyntfs ndyntfs
7-7NTFS 7-7NTFS 7-3-5 NTFS Windows VistaNTFS NTFS NTFS NTFS NTFS CNTFS C:\Report1 GroupX GroupY GroupZ 6 7.3 NTFS315
3167 6 jackgroupxgroupygroupz jackc:\report1 Windows Vista Step1 Step2 (C:)C:\ Report1 Step3 C:\Report1Report1 Report1
6 7-7 Step4 jack Step5 Report1 jackjack C:\Report17-7- 7.3 NTFS317
317 6 Override jackc:\report1 jackc:\report1\ch4.doc jackc:\report1\ch4.doc helendenyc:\report1 C:\Report1\ReadME.txt helenc:\report1\readme.txt helenc:\report1 C:\Report1helen ReadME.txt notepad C:\Report1\ ReadME.txtReadME.txt jackc:\report1
jack GroupX 6 GroupY GroupZ jackc:\report1 jack NTFS Windows Vista NTFS ndy C:\Report1 ndyc:\report1 7-7-CH4.doc C:\Report1 7.3 NTFS31
3207 6 () () 7-7- 7-
7- Windows Vista Step1 Step2 C:\Report1C:\ Report1 Step3 Report1 7-10 6 7.3 NTFS321
3227 6 7-10 Step4 Windows7-11 7-11