/L: size — NTFS only. It changes the log file size.
/R — Locates bad sectors, and recovers readable information (implies /F).
/V — On FAT, it displays the full path and name of every file on the disk. On NTFS, it displays cleanup messages, if there are any.
/X — Forces the volume to dismount first if necessary (implies /F). For NTFS volumes, Check Disk supports these enhanced options:
/forceofflinefix — Must be used with /scan. It bypasses all online repair and queues errors for offline repair.
/offlinescanandfix — Performs an offline scan and fix of the volume.
/perf — Performs the scan as fast as possible by using more system resources.
/scan — Performs an online scan of the volume (the default). Errors detected during the scan are added to the $corrupt system file.
/sdcleanup — Cleans up unneeded security descriptor data. It implies /F (with legacy scan and repair).
/spotfix — Allows certain types of errors to be repaired online (the default).
You can run Check Disk interactively through File Explorer or Disk Management by following these steps:
1. Press and hold or right-click the drive, and then tap or click Properties.
2. On the Tools tab of the Properties dialog box, tap or click Check. This displays the Error Checking dialog box, shown in Figure 2-10.
FIGURE 2-10 Use Check Disk to check a disk for errors and repair any that are found.
3. Click Scan Drive to start the scan. If no errors are found, Windows confirms this; otherwise, if errors are found, you’ll be prompted with additional options. As with checking disks at a prompt, the way this works depends on whether you are working with a system or nonsystem volume.
NOTE For FAT, FAT32, and exFAT volumes, Windows uses the legacy Check Disk. You tap or click Scan And Repair Drive to start the scan. If the scan finds errors, you might need to restart the computer to repair them.
Analyzing and optimizing disks
Any time you add files to or remove files from a drive, the data on the drive can become fragmented. When a drive is fragmented, large files can’t be written to a single continuous area on the disk. As a result, the operating system must write the file to several smaller areas on the disk, which means more time is spent reading the file from the disk. To reduce fragmentation, Windows Server 2012 R2 can manually or automatically analyze and optimize disks by using the Optimize Drives utility.
With manual optimization, Optimize Drives performs an online analysis of volumes, and then reports the percentage of fragmentation. If defragmentation is needed, you can then elect to perform online defragmentation. System and boot volumes can be defragmented online as well, and Optimize Drives can be used with FAT, FAT32, exFAT, NTFS, and ReFS volumes.
You can manually analyze and optimize a disk by following these steps:
1. In Computer Management, select the Storage node and then the Disk Management node. Press and hold or right-click a drive, and then tap or click Properties.
2. On the Tools tab, tap or click Optimize. In the Optimize Drives dialog box, select a disk, and then tap or click Analyze. Optimize Drives then analyzes the disk, as shown in Figure 2-11, to determine whether it needs to be defragmented. If so, it recommends that you defragment at this point.
3. If a disk needs to be defragmented, select the disk, and then tap or click Optimize.
NOTE Depending on the size of the disk, defragmentation can take several hours. You can tap or click Stop Operation at any time to stop defragmentation.
FIGURE 2-11 Optimize Drives analyzes and defragments disks efficiently.
Automatic analysis and optimization of disks can occur while the disks are online, so long as the computer is on AC power and the operating system is running but otherwise idle. By default, disk optimization is a weekly task rather than a daily task-and there’s a good reason for this. Normally, you need only to periodically optimize a server’s disks, and optimization once a week is sufficient in most cases. Note, however, that although nonsystem disks can be rapidly analyzed and optimized, it can take significantly longer to optimize system disks online.
You can control the approximate start time for the analysis and optimization of disks by changing the automated maintenance start time. Windows Server also notifies you if three consecutive runs are missed. All internal drives and certain external drives are optimized automatically as part of the regular schedule, as are new drives you connect to the server.
NOTE Windows Server 2012 R2 automatically performs cyclic pickup defragmentation. With this feature, when a scheduled defragmentation pass is stopped and rerun, the computer automatically picks up where it left off or starts with the next unfinished volume in line to be defragmented.
You can configure and manage automated defragmentation by following these steps:
1. In Computer Management, select the Storage node and then the Disk Management node. Press and hold or right-click a drive, and then tap or click Properties.
2. On the Tools tab, tap or click Optimize. This displays the Optimize Drives dialog box.
3. If you want to change how optimization works, tap or click Change Settings. This displays the dialog box shown in Figure 2-12. To cancel automated defragmentation, clear the Run On A Schedule check box. To enable automated defragmentation, select Run On A Schedule.
FIGURE 2-12 Set the run schedule for automated defragmentation.
4. The default run frequency is set as shown. In the Frequency list, you can choose Daily, Weekly, or Monthly as the run schedule. If you don’t want to be notified about missed runs, clear the Notify Me check box.
5. If you want to manage which disks are defragmented, tap or click Choose, and then select the volumes to defragment. By default, all disks installed within or connected to the computer are defragmented, and any new disks are defragmented automatically as well. Select the check boxes for disks that should be defragmented automatically, and clear the check boxes for disks that should not be defragmented automatically. Tap or click OK to save your settings.
6. Tap or click OK, and then tap or click Close.
CHAPTER 3: Data sharing and redundancy
■ Using and enabling file sharing
■ Configuring standard file sharing
■ Managing share permissions
■ Managing existing shares
■ Configuring NFS sharing
■ Using shadow copies
■ Connecting to network drives
■ Configuring synced sharing
The Server Message Block (SMB) protocol is the primary file sharing protocol used by computers running Windows. When folders are shared over a network, an SMB client reads and writes to files and requests services from computers hosting SMB-shared folders. With SMB, Windows Server 2012 R2 supports standard file sharing and public folder sharing. Standard file sharing makes it possible for remote users to access network resources such as files, folders, and drives. When you share a folder or a drive, you make all its files and subfolders available to a specified set of users. Because you don’t need to move files from their current location, standard file sharing is also referred to as in-place file sharing .