![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-15 10:35 |
47,813 topics / 349,903 posts / today 1 new / 48,257 members |
| DOS疑难解答 & 问题讨论 (解答室) » [Discussion] How to accurately determine the location of the system disk in pure DOS |
| Printable Version 2,495 / 12 |
| Floor1 bugs | Posted 2010-10-08 09:23 |
| 新手上路 Posts 13 Credits 18 | |
|
In a multi-hard drive environment with multiple active partitions, and given each partition and drive letter, etc. What method can be used under pure DOS to determine the location of the system drive to be backed up? I thought of a method which is to judge through files exclusive to XP or Win7, I don't know how accurate it is, and I want to listen to everyone's ideas.
|
|
| Floor2 qzwqzw | Posted 2010-10-09 23:06 |
| 银牌会员 Posts 636 Credits 2,343 | |
|
In this case, it is suggested not to make any intelligent judgments. Letting users make their own choices is the best approach. Because intelligent selection is aimed at novice users, and such users are extremely unlikely to encounter the above - mentioned complex situations. And for advanced users using the above - mentioned environments, usually there is no need to arbitrarily make decisions for the other party, because the other party may have their own unique needs, such as data area or multi - partition backup. Moreover, the partition situation can be very simple or very complex. Various complex situations such as multiple hard disks, multiple active partitions, multiple file systems, multiple systems, cross - partition systems and so on are hard to list exhaustively.
|
|
| Floor3 bugs | Posted 2010-10-10 09:20 |
| 新手上路 Posts 13 Credits 18 | |
|
It is indeed the case, and it feels quite complicated.
Thanks! If using a unique file or directory to judge should be much more accurate than the general Windows form, right? [ Last edited by bugs on 2010-10-10 at 09:22 ] |
|
| Floor4 fujianabc | Posted 2010-10-10 09:55 |
| 金牌会员 Posts 1,616 Credits 3,467 | |
|
First, create a temporary identification file or folder in the system drive under Windows. Then restart and enter DOS, and after operation, delete this identification file.
|
|
| Floor5 qzwqzw | Posted 2010-10-12 23:54 |
| 银牌会员 Posts 636 Credits 2,343 | |
|
My suggestion is still not to consider multiple hard drives or multiple partitions. Just smartly point the target to the first partition of the first hard drive. After all, this is the situation for over 90% of users. And for the other 10% of users, leaving a manual option is enough. You should know that generally, the more intelligent a program is, the more complex it usually is, which means it is more prone to bugs. You will often find that after you spend 90% of your energy solving 10% of the problems, the size of your code increases by ten times or more. This means that the probability of new problems increases by 100 times or more. The balance between giving up and getting needs to be carefully considered.
|
|
| Floor6 bugs | Posted 2010-10-13 14:49 |
| 新手上路 Posts 13 Credits 18 | |
|
Thanks for the reply!
What are the possible errors in the judgment if a unique file exists in the system disk? |
|
| Floor7 bc12060101 | Posted 2010-10-13 16:06 |
| 银牌会员 Posts 712 Credits 1,455 | |
Originally posted by qzwqzw at 2010-10-12 23:54: Hehe, seriously agree! |
|
| Floor8 qzwqzw | Posted 2010-10-13 20:38 |
| 银牌会员 Posts 636 Credits 2,343 | |
Originally posted by bugs at 2010-10-13 14:49: Really persistent "If there is a unique file set on the system disk" Since you already know the system disk, why do you need to judge the system disk Isn't this a logical paradox? I know what you mean is Mark files in Windows Read file marks in DOS But I want to ask how you confirm the system disk in Windows? Environment variables, WMIC, system files or other advanced technologies? You know that all these technologies cannot solve the problem of multiple systems Especially the problem of cross-platform multiple systems You are booted into the Windows system of partition X Can you be sure that partition Y is not a system partition So no need to back up? If you can't confirm the system disk in Windows How to make the program under DOS recognize the mark? Moreover, using files as partition marks Actually, it is a very unwise behavior Because in program design We have to mix partition operations with file operations And we know that they are actually two levels of things In the correspondence between these two levels of relationships Even professional software may not do it well Let alone self-written code Is the partition number so simple to the drive letter? [ Last edited by qzwqzw on 2010-10-13 at 20:44 ] |
|
| Floor9 bugs | Posted 2010-10-13 22:33 |
| 新手上路 Posts 13 Credits 18 | |
|
I assume an environment.
There are 3 hard disks, each hard disk has 2 partitions, and the corresponding relationships are as follows: 1-1 C xp 1-2 D win2003 2-1 E 2-2 F 3-1 G win7 3-2 H If you want to back up the win2003 system, boot into the system, and know that the corresponding partition is drive D of 1-2, then I generate a mark file in drive D, and then detect the mark file in DOS. Detecting it means it is the system that needs to be backed up. Is there any problem with this judgment? I didn't understand where the problem is. Please give me some pointers, thank you! |
|
| Floor10 qzwqzw | Posted 2010-10-14 22:09 |
| 银牌会员 Posts 636 Credits 2,343 | |
|
Then what you mean is that the user needs to decide which system to back up, first boot into the corresponding system, then run your software to restart to DOS for backup, instead of backing up the partition of another system under one system.
In this way, it seems that you are not going to consider users of Linux systems, but simply want to make a program similar to one-click backup and restore under Windows. This process actually involves 3 processes: writing a marker file to the partition of the current system you think, restarting to a DOS Shell, reading the marker files of all drive letters in order under DOS, and finally backing up and restoring the system according to the drive letters. First, look at process 1. If the system boot program is in the first partition and the system main folder is in the second partition, which partition do you think should be backed up? If the system unfortunately uses dynamic disks, then except for simple volumes, spanned volumes, striped volumes, and RAID-5 volumes will merge multiple disk spaces into one volume. Which partition do you think should be backed up? If the system uses the NTFS file system and uses MountPoint to mount other data partitions as a directory of the system volume, is there a possibility that your file marker is exactly written to this MountPoint directory? If a PE system is booted and the system volume is on a memory virtual disk, how should the backup be done after restarting? If it is a diskless workstation Windows, how should the backup be done? What if it is a Windows system with a shadow system or a restore card? Then look at process 2. Restarting to boot into DOS seems simple. It only needs to write a boot entry to boot.ini under the system volume and then use the way of grldr or bootsect.dos to start. The problem is that the boot partition must specify the drive letter or partition number of the boot partition, and it is as confused as the problem in process 1. Finally, look at process 3. After entering DOS, read the marker file. If there is an NTFS partition on the hard disk, the NTFS driver must be mounted. And basically, no matter what driver it is, it is after the CD-ROM driver, and the USB boot device that may be inserted will also be loaded, which makes the drive letter order under DOS very different from the physical partition order, and the CD-ROM drive letter may be confused among them. If there is no CD in the CD-ROM, then when traversing all drive letters to read the file, reading the CD-ROM without a CD will definitely report an error, and a lot of code is needed for error handling, and then continuous debugging... |
|
| Floor11 bugs | Posted 2010-10-14 22:25 |
| 新手上路 Posts 13 Credits 18 | |
|
Process 1:
1. Taking XP as an example, the system is started by ntldr reading the boot.ini file. I don't know how to separate the boot file ntldr from the Windows main directory. Please tell me your method so that I can test it. 2. As for what you said that it is very unfortunate to use a dynamic disk system. This point is not valid. Because dynamic disks will prompt that they cannot be recognized during the installation process in XP and 2003, and the system will not be installed. I don't know if it is the same under Win7. I will do a test when I have time later. 3. Using MountPoint to mount other data partitions as a directory of the system volume. This method is the first time I have heard of it. If the identification file is in the root directory of the system disk, this should not be a problem. 4. I don't know how many people usually use the computer in the PE environment, so I really didn't think about this aspect. I still need to think more. 5. I think there is no need to back up the system for a diskless system. 6. I have never used Shadow System and don't know much about it. I will also install and test it when I have time. But I have come into contact with both hard restoration and soft restoration for systems with restoration. I really can't figure out the difference between them and the normal system when the restoration is not protected. Even if the system recovery is done with the restoration enabled, except that IcePoint needs to do some processing, other restoration systems will run normally. (The restoration system software I have come into contact with is relatively few, only IcePoint, NetWin, EasyNet, Xunsan, etc.) Process 2, 3 Can I understand that it is the problem of identifying the hard disk partition number and drive letter under DOS? If that's the case, there should be no problem. [ Last edited by bugs on 2010-10-15 at 18:47 ] |
|
| Floor12 fujianabc | Posted 2010-10-16 18:36 |
| 金牌会员 Posts 1,616 Credits 3,467 | |
|
1. Choose to install the system to a non-activated primary partition, and ntldr and the windows folder will be in different partitions.
2. You can convert to a dynamic disk after installing the system. 3. Theoretically, you can mount the boot partition in a folder without assigning a drive letter. I used to do this for a period, mounting the partition where ntldr is located to the c:盤 boot folder. |
|
| Floor13 bugs | Posted 2010-10-21 07:19 |
| 新手上路 Posts 13 Credits 18 | |
|
1. Separation of system boot files and system directories
In the environment simulated by the virtual machine: 1-1 Active primary partition 1-2 Primary partition 1-3 Extended partition For the WinXP system: There are ntldr, boot.ini, bootfon.bin, ntdetect.com, msdos.sys, io.sys under 1-1, and other files and directories are under 1-2. For the Win7 system: There is a boot directory and bootmgr under 1-1, and other files and directories are under 1-2. That is to say, if this kind of use environment is detected, only the corresponding files need to be processed. If you don't care about the size of the backup file, you can back up 1-1 and 1-2 together, but I don't think it is necessary. 2. Dynamic disks First, talk about spanned volumes, striped volumes, etc... If other types besides simple volumes are adopted, Ghost cannot recognize them and cannot be backed up. So I think there is no need to deal with this type. Then talk about simple volumes. I am using ifs now, which supports ntfs/ext2/ext3 and hidden partitions, but does not support dynamic disks - -! ntfs4dos supports dynamic disks, but others do not. To choose between simple volumes and ext2/ext3, hidden partitions, I choose the latter. If you have a better way to recognize various partition types at the same time, you can tell me, thank you! 3. The boot partition is mounted in a folder without assigning a drive letter I didn't find any software or method to simulate this environment, please tell me, thank you! |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |