China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-30 05:09
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Disk sector reading and writing, partition information management tool Dsptw (updated on 2008.11.29) View 112,549 Replies 565
Floor 16 Posted 2006-11-21 07:49 ·  中国 浙江 衢州 电信
银牌会员
★★★
Credits 1,270
Posts 548
Joined 2004-05-31 00:00
22-year member
UID 25754
Gender Male
Status Offline
Attachment 1: new.rar (2006-11-18 03:53 AM, 24.45 K, Download Count: 3) - This is the note I made when downloading. It seems that this bug needs more people to test to find out where the problem really is.
Floor 17 Posted 2006-11-21 08:10 ·  中国 浙江 衢州 电信
银牌会员
★★★
Credits 1,270
Posts 548
Joined 2004-05-31 00:00
22-year member
UID 25754
Gender Male
Status Offline
Originally posted by 19951001 at 2006-11-20 10:26 PM:

You are the following version, I changed the search order.

Tried this version, the command dpit 0 /s 0dbr.bin /dbr shows DONE! It seems normal now.
Floor 18 Posted 2006-11-24 01:05 ·  中国 福建 泉州 石狮市 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
I tried it.

DISK SECTOR READER/WRITER & PARTITION TOOLS FOR WIN32
COPYRIGHT BY WANGRUILIN, LAST COMPILE DATE: 2006-11-21
E-MAIL: BEST_WRL@YAHOO.COM.CN or TSWRL1115@163.COM

Disk Partitions Cylinders Heads Sectors TotalSectors Mbytes
0 5 9562 255 63 153613530 75006
No. Type PartitionType Active StartSector Sectors MBytes
1 Primary Win95 FAT32 Yes 63 15004647 7326
2 Primary Hide FAT32 15004710 15711570 7671
* Extended 30716280 122897250 60008
3 Logic HPFS/NTFS 30716343 40965687 20002
4 Logic HPFS/NTFS 71682093 40965687 20002
5 Logic HPFS/NTFS 112647843 40965687 20002

This shows that Extended is present, but the NO. before it also needs to be assigned a partition number.
Because to know, for example, which logical partition 5 is.
Of course, it's clear from the above, but in a batch script, it can't be determined.
If a partition number is assigned, then the above one is 3, and the subsequent ones are incremented accordingly.
In the batch script, 6-3 can determine it's the 3rd logical partition.
QQ:366840202
http://chenall.net
Floor 19 Posted 2006-11-24 22:22 ·  中国 北京 华北计算技术研究所
高级用户
★★
流落街头
Credits 570
Posts 272
Joined 2005-10-17 10:51
20-year member
UID 43609
Gender Male
From 北京
Status Offline
In the DOS version, this extended partition is assigned a partition number, and the next version updates the Windows version.
Floor 20 Posted 2006-11-25 12:09 ·  中国 福建 泉州 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
I have downloaded the new version, thank you.

Then the program in my toolbox can use dpitw to handle it, no longer using GDISK32.

But there is still a function I don't know if it can be added.

That is, you can add a parameter to modify the specified partition to be hidden.

For example, after I handle it through DPITW, I determine a certain partition, and now I want to hide this partition.

For example, hide the 6th partition displayed by dpitw 0 /l through dpitw 0 /hide:6.

Need to modify the partition table to change the partition flag to the hidden flag.

[ Last edited by chenall on 2006-11-25 at 12:17 PM ]
QQ:366840202
http://chenall.net
Floor 21 Posted 2006-11-30 03:59 ·  中国 福建 泉州 石狮市 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
Downloaded version.
dpitw 0 /hide:6 Hide partition 6 OK!
dpitw 0 /unhide:6 Show partition 6 OK!
No problems found for the time being.
QQ:366840202
http://chenall.net
Floor 22 Posted 2006-11-30 20:06 ·  中国 江苏 南京 电信
高级用户
★★
Credits 525
Posts 222
Joined 2006-08-28 21:07
19-year member
UID 61476
Status Offline
Originally posted by chenall at 2006-11-30 03:59:
Downloaded version.
dpitw 0 /hide:6 Hide partition 6 OK!
dpitw 0 /unhide:6 Show partition 6 OK!
No problems found for the time being.


I still have some doubts about this: Is it just modifying the partition ID?
If this is added, then I would like to make a few suggestions.

1. It would still be somewhat convenient to add a /act:N parameter to activate a certain primary partition, which can replace software like BOOTMAGIC.
The important thing is that it can be operated from the command line. There's no need to enter the main interface of the partition software.

2. If you can add a /m parameter (Menu) to implement menu wizard-style operation, (or enter the wizard mode by default without parameters, which should be easy, just select and do),
it will be felt that the usability is greatly enhanced.

For example under DOS: (This is what I thought later)
Enter dXXX.com (it's best to enter without parameters)
Output copyright information
Output Menu
1. List disk info 4. Rebuild MBR
2. R/S disk pt/dbr 5. Hide/Act Partion(or better to separate)
3. R/S disk sec
I abbreviated R/S, if it is really added, it can be more detailed.



3. Can /mbr also be added? Then you can get rid of Fdisk; currently I use spfdisk /mbr to rebuild MBR;

Of course, I'm just putting forward my suggestions. As for whether to add so many functions, it still depends on the author.
Although I don't advocate making the program large, some necessary operations can indeed be added.


By the way, as for renaming to achieve no prompt information, I personally think it's more troublesome to change it every time you update. Otherwise, you can provide all the modified programs. Then I can directly overwrite after downloading.

[ Last edited by cchessbd on 2006-11-30 at 08:09 PM ]
Floor 23 Posted 2006-11-30 22:32 ·  中国 北京 华北计算技术研究所
高级用户
★★
流落街头
Credits 570
Posts 272
Joined 2005-10-17 10:51
20-year member
UID 43609
Gender Male
From 北京
Status Offline
Originally posted by cchessbd at 2006-11-30 20:06:


I still have some questions about this: Is it just modifying the partition ID?
If this is added, then I would like to make a few suggestions.

1. Adding a /act:N parameter is still a bit convenient
To activate a primary partition, it can replace software like BOOTMAGIC.
The important thing is command-line operation. There's no need to enter the main interface of the partition software.

2. If you can add a /m parameter (Menu) to implement menu wizard-style operation, (or without parameters, it defaults to the wizard mode, which should be easy, just select what to do)
The usability will be greatly enhanced.

For example, under DOS: (This is what I thought later)
Enter dXXX.com (I think entering without parameters is best)
Output copyright information
Output Menu
1. List disk info 4. Rebuild MBR
2. R/S disk pt/dbr 5. Hide/Act Partion(or it's better to separate)
3. R/S disk sec
R/S is abbreviated by me, and it can be detailed if really added.



3. Can /mbr also be added? Then you can get rid of Fdisk; currently I use spfdisk /mbr to rebuild the MBR;

Of course, I'm just giving my suggestions. As for whether to add so many functions, it depends on the author.
Although I don't advocate making the program large, some necessary operations can indeed be added.


By the way, as for changing the name to achieve no prompt information, I personally think it's tedious to change it every time an update is made. Otherwise, you can provide all the modified programs. Then I can directly overwrite them when I download them.


1. Hiding/showing partitions only modifies the partition flag.

2. Adding a /act:N parameter will be implemented in the next version.

3. Adding a menu is completely possible, but recently I have exams, and the implementation of this function will take some time.

4. Using the parameter /mbr, adding the standard MS master boot record can be added, but just because I don't advocate modifying the master boot record, in case of encountering some special master boot records, it may cause the system to be unable to boot.

5. I only keep the latest version, and I generally don't keep previous versions.


I made a new version as per your request. Under DOS, dpit adds the /find:type parameter, where type can be: all, fat, fat12, fat16, fat32, ntfs, linux.

The following is the execution result of dpit 0 /find:all:

No. Type PartitionType Active StartSector Sectors MBytes
0:1 Primary DELL FAT 63 64197 31
0:2 Primary HPFS/NTFS Yes 64260 20418615 9970
0:3 Extended 20482875 135749250 66283
0:4 Logic Win95 FAT32 20482938 21061152 10283
0:5 Logic HPFS/NTFS 41544153 20482812 10001
0:6 Logic HPFS/NTFS 62027028 20482812 10001
0:7 Logic HPFS/NTFS 82509903 20482812 10001
0:8 Logic HPFS/NTFS 102992778 20482812 10001
0:9 Logic HPFS/NTFS 123475653 16386237 8001

Different from ghost, the disk numbering in ghost starts from 1, here it starts from 0, and ghost does not include the above 0:3 partition. It is completely possible to make it consistent with ghost.

Please download from the first floor.

[ Last edited by 19951001 on 2006-12-1 at 03:09 AM ]
Floor 24 Posted 2006-12-01 03:11 ·  中国 北京 华北计算技术研究所
高级用户
★★
流落街头
Credits 570
Posts 272
Joined 2005-10-17 10:51
20-year member
UID 43609
Gender Male
From 北京
Status Offline
There is a bug in the November 29 version, which has been fixed. If you have downloaded the 2006.11.29 version, please download it again.
Floor 25 Posted 2006-12-01 08:35 ·  中国 江苏 苏州 电信
初级用户
Credits 37
Posts 20
Joined 2006-10-20 05:40
19-year member
UID 67176
Status Offline
Thanks for sharing.
The poster has worked hard.
Very good.
Floor 26 Posted 2006-12-02 22:01 ·  中国 江苏 南京 联通
高级用户
★★
Credits 525
Posts 222
Joined 2006-08-28 21:07
19-year member
UID 61476
Status Offline
Originally posted by 19951001 at 2006-11-30 22:32:


1. Hiding/showing partitions only modifies the partition flag.

2. Adding a /act:N parameter will be implemented in the next version.

3. Adding a menu is completely possible, but recently I have exams, this function...


If there is no time, it's okay.
Having the find function is also good, at least not misidentifying partitions.
It is suggested to standardize the display. There are GHOST, GRUB, GRUB2. I can't remember exactly, but there are differences anyway.
It will also be convenient for the future.
Floor 27 Posted 2006-12-04 21:50 ·  中国 北京 华北计算技术研究所
高级用户
★★
流落街头
Credits 570
Posts 272
Joined 2005-10-17 10:51
20-year member
UID 43609
Gender Male
From 北京
Status Offline
2006.12.04 update

DPITW
Disk: 0-First Hard disk, 1-Second Hard Disk, ...
/S: Save Disk Partition Info to File.
/R: Restore Disk Partiton Info from File.
/C: Compare Disk Partiton Info with File.
FileName: Disk Partition Info File.

DPITW
Save Partition Boot Record to File.
DPITW
List Disk Partition Info on Screen.
DPITW
Active Disk Partition n.
DPITW
Find Disk Partition.
type: Can be FAT16/FAT32/FAT/NTFS/LINUX/ALL.
DPITW
ReBuild Disk Main Boot Record.
/NOBACK: Don't Backup old MBR.
DPITW
Hide/Unhide Disk Partition n.

2006.12.4
1. dpit implements the /mbr parameter to rebuild the main boot record.
2. Change the display information to be more explicit.
3. Backup DBR. I have consulted some materials. The boot record of FAT32 is 3 sectors, and the boot record of NTFS is 7 sectors. The program has been corrected.
Floor 28 Posted 2006-12-05 19:59 ·  中国 江苏 南京 电信
高级用户
★★
Credits 525
Posts 222
Joined 2006-08-28 21:07
19-year member
UID 61476
Status Offline
This is good. Hope there are no bugs.
Haha.
Thanks for your hard work.

[ Last edited by cchessbd on 2006-12-5 at 08:01 PM ]
Floor 29 Posted 2006-12-05 22:10 ·  中国 北京 华北计算技术研究所
高级用户
★★
流落街头
Credits 570
Posts 272
Joined 2005-10-17 10:51
20-year member
UID 43609
Gender Male
From 北京
Status Offline
2006.12.5
In the 3 sectors of the FAT32 boot record, the second one contains the total number of clusters and the next available cluster, which are variable values and cannot be recovered. Now, restore the program to save only the first sector of each partition when saving the DBR. If you have downloaded the 20061204 version, please re - download it.

The number of partitions that can be processed per disk is increased to 40.

[ Last edited by 19951001 on 2006 - 12 - 22 at 06:17 AM ]
Floor 30 Posted 2006-12-08 07:59 ·  中国 江苏 南京 联通
高级用户
★★
Credits 525
Posts 222
Joined 2006-08-28 21:07
19-year member
UID 61476
Status Offline
Perhaps a function can also be added, referring to the backup and recovery of Hongqingting (EditTool 1.0).
/SDE|RDE|CDE respectively represent backing up to the last sector, restoring from the last sector, and comparing with the last sector backup.
In this way, when all partitions are deleted, you can still restore by restarting from other media. It is recommended to back up MBR, DBR, and PT all. Then when restoring, you can choose which one to restore.
Also, it is suggested to combine the four programs (two with prompt information and two without) into a fixed program. Each function can be realized by adding appropriate parameters.
Without a fixed program name, it is difficult to expand the application range. The reason why SRCTOOLS is used by so many people is not just by changing the name. Moreover, if you want to use a certain program, (in the batch processing) you first need to rename it, then call it, after using diskrw, then using dpit for backup, and you have to rename it again. The same is true for restoration, which is very troublesome. Adding parameters, I think it should be more convenient.

Does saving the DBR only save the first sector of each partition?
If the boot information of a certain partition is written with new data by another software, and then I want to restore it, how to do it?
Forum Jump: