search
HomeComputer TutorialsComputer KnowledgeUSB hard disk detection code
USB hard disk detection codeFeb 11, 2024 pm 05:10 PM
U diskharddiskwin10win10 system

php editor Yuzai brings you a practical U disk hard drive detection code. This code can help users quickly detect the status and available space of U disks and hard disks, allowing users to easily understand the status of storage devices. The code is concise and efficient, and easy to use. No complicated configuration and installation are required. You only need to copy the code to your own project to use it. Both developers and ordinary users can easily manage their own storage devices through this code and improve the efficiency of work and life.

The previous article introduced the method of using diskgenius to clone the hard disk. Under the premise that the hard disk is in MBR format, we can choose to copy all sectors or clone the file system structure as it is. Today we will use the file-by-file copy method to test whether the system can be booted correctly after the cloning is completed.

First of all, let’s introduce the current situation of computer hard drives.

USB hard disk detection code

Hard drive usage

Currently there are two hard drives, one is a 120G solid-state drive, which is used as the main boot disk and has the WIN10 operating system installed. The other is a 160G mechanical hard drive as a secondary drive. Our goal is to clone the system in the 120G solid state drive to a 160G mechanical hard drive.

Due to the cloning of the system disk, it is not suitable for operation in a running WIN10 system. Because the running system will have some files open, the system files may be incomplete during cloning, resulting in boot failure.

USB hard disk detection code

Set the USB boot in bios

We use the USB boot disk with PE to boot the system. First, set the U disk as the first boot disk in the motherboard's BIOS. Since different motherboards may have different setting methods, you can find the setting method for the specific motherboard by yourself.

USB hard disk detection code

Open disktenius and select hard disk clone

After entering the PE system, select diskgenius disk wizard.

Select the Tools menu and clone the hard drive.

First select a 120G solid-state drive as the source disk, and then select a 160G hard disk as the target disk.

USB hard disk detection code

Select clone by file copy method

After confirmation, there are three cloning methods to choose from. Copy all sectors and copy the file system structure as it is. We have tested it and it can start normally without any problems. Today I will test the third one, copy by file (which can eliminate fragmentation).

After completing the selection, press Start. Due to the large amount of data, it may take a long time.

After the cloning is completed, unplug the USB flash drive and solid-state drive, and only use the 160G mechanical hard drive to boot.

USB hard disk detection code

Error code 0xc000000e

It was found that the win10 system failed to boot, showing that the required device is not connected or cannot be accessed, prompting error code 0xc000000e.

USB hard disk detection code

File winload.exe error

The following prompts to press F8 to specify startup settings. After pressing F8, it says that the application or operating system cannot be loaded because the required files are missing or contain errors. File: \windows\system\windload.exe

Hard disk cloning, using the file-by-file copy method, did not boot the win10 system correctly. Because the system could not find the boot device, the system file winload was damaged or inaccessible. The reason is that the drive is not configured correctly.

Here are the repair methods.

USB hard disk detection code

Enter cmd in pe to enter the command mode

Use the USB disk to boot into the PE system, select Start, Run, enter CMD to enter the command mode. Enter the following command.

USB hard disk detection code

Repair the default boot device

c:

cd c:\windows\system32

bcdedit /set {default} osdevice boot

bcdedit /set {default} device boot

bcdedit /set {default} detecthal 1

exit

The above statement, first enter the C drive, Enter the system32 folder of the system, set the default boot device, and then exit the command mode.

Exit PE and reboot the system with a 160G hard drive. Win10 enters normally.

USB hard disk detection code

Commands to repair boot devices.

The above is the detailed content of USB hard disk detection code. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:电脑知识学习网. If there is any infringement, please contact admin@php.cn delete
文件怎么保存到u盘文件怎么保存到u盘Aug 29, 2023 pm 03:18 PM

文件保存到u盘的方法:1、准备好一台计算机和一个U盘;2、将U盘插入计算机的USB接口;3、在计算机的任务栏上,找到资源管理器图标单击打开;4、选择要保存的文件;5、右键单击文件,然后选择“复制”选项;6、粘贴文件到U盘;7、等待文件复制完成;8、确认文件已成功保存到U盘;9、安全拔出U盘即可。

电脑u盘装系统按什么键进入u盘启动电脑u盘装系统按什么键进入u盘启动Jul 14, 2023 pm 05:37 PM

当电脑出现系统故障问题无法进入系统的时候,我们可以通过制作u盘启动盘重装系统解决。但是u盘装系统时需要设置u盘启动进pe才能重装。那么电脑u盘装系统按什么键进入u盘启动呢?下面小编就教下大家电脑开机按什么键进入u盘启动。方法一:开机按启动快捷键1、在电脑上插入启动U盘,重启电脑时不停按F12、F11、Esc或F8快捷键,不同品牌电脑启动热键如图所示。2、弹出启动菜单,KingstonDataTravelerG21.00或GeneralUDisk5.00或USB选项都是U盘启动项,DVD-RAM则

u盘发烫是什么原因u盘发烫是什么原因Oct 28, 2022 pm 02:54 PM

u盘发烫是属于正常的现象,u盘的内部是由许多电子元件所组成,需要通过电脑主机箱上的usb插口处进行通电,并通过系统的读取方能使用;使用u盘的时间有所不同,它内部的电子元件也会随着u盘运转持续时间的变长而慢慢发热。

u盘是哪个国家发明的u盘是哪个国家发明的Oct 09, 2022 pm 02:26 PM

u盘是中国发明的,朗科公司是U盘的全球发明者。2002年7月,朗科公司的“用于数据处理系统的快闪电子式外存储方法及其装置”获得国家知识产权局正式授权,该专利填补了中国计算机存储领域20年来发明专利的空白;2004年12月7日,朗科获得美国国家专利局正式授权的闪存盘基础发明专利。

u盘是什么u盘是什么Jan 31, 2023 am 11:45 AM

u盘是指“USB闪存盘”;U盘是闪存的一种,故有时也称作闪盘;U盘集磁盘存储技术、闪存技术及通用串行总线技术于一体;其与硬盘的最大不同是,它不需物理驱动器,即插即用,且其存储容量远超过软盘,极便于携带。

大白菜U盘重装win7教程大白菜U盘重装win7教程Jul 19, 2023 pm 06:09 PM

win7系统界面美观,系统性能好,用户多。然而,无论计算机系统有多好,都不可避免地会遇到无法修复的故障。因此,我们可以重新安装计算机系统。如果您不知道w7系统的重新安装步骤,可以参考下面介绍的大白菜u盘重新安装win7教程。大白菜U盘重装win7教程。1.制作uefipe启动U盘后,将win764位系统iso镜像直接复制到U盘gho目录下;2.将U盘插入UEFI计算机,启动后不断按F12.F11.Esc等快捷键,在弹出的启动项选择框中,选择识别的U盘启动项,如有UEFI启动项,则选择UEFI前缀

u盘是硬盘还是软盘u盘是硬盘还是软盘Aug 23, 2022 am 11:29 AM

u盘既不是硬盘,也不是软盘。U盘是一种使用USB接口的无须物理驱动器的微型高容量移动存储产品,它是闪存的一种,集磁盘存储技术、闪存技术及通用串行总线技术于一体。U盘与硬盘的最大不同是:它不需物理驱动器,即插即用;且U盘的存储容量远超过软盘,极便于携带。

格式化u盘有什么后果格式化u盘有什么后果Jan 13, 2021 pm 05:32 PM

格式化u盘的后果:1、清空U盘,会将u盘中的文件全部删除;2、可以消除U盘上的一些逻辑性的错误和非顽固性病毒或流氓程序;3、如果经常性反复格式化u盘,会降低U盘的使用寿命。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.