/// <summary>
 /// Updates the CHS fields in partition records to reflect a new BIOS geometry.
 /// </summary>
 /// <param name="geometry">The disk's new BIOS geometry</param>
 /// <remarks>The partitions are not relocated to a cylinder boundary, just the CHS fields are updated on the
 /// assumption the LBA fields are definitive.</remarks>
 public void UpdateBiosGeometry(Geometry geometry)
 {
     _partitionTable.UpdateBiosGeometry(geometry);
     _biosGeometry = geometry;
 }
Esempio n. 2
0
        private static void UpdateBiosGeometry(SparseStream contentStream, Geometry oldGeometry, Geometry newGeometry)
        {
            BiosPartitionTable partTable = new BiosPartitionTable(contentStream, oldGeometry);
            partTable.UpdateBiosGeometry(newGeometry);

            VolumeManager volMgr = new VolumeManager(contentStream);
            foreach (var volume in volMgr.GetLogicalVolumes())
            {
                foreach (var fsInfo in FileSystemManager.DetectDefaultFileSystems(volume.Open()))
                {
                    if (fsInfo.Name == "NTFS")
                    {
                        using (NtfsFileSystem fs = new NtfsFileSystem(volume.Open()))
                        {
                            fs.UpdateBiosGeometry(newGeometry);
                        }
                    }
                }
            }
        }