在Amazon上调整EBS卷大小时,我意外地删除了ext4签名。
root@server:~# fdisk /dev/xvdf
Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
Command
我已经打开卷USB设备,并在Windows中使用CreateFile()和DeviceIoControl()锁定。
我想在Linux/Unix系统上使用相同的功能。我是Unix的新手,如何获得它?
我的Windows代码:
HANDLE handle = CreateFile(L"\\\\.\\F:", // F: drive to open
GENERIC_READ, // no access to the drive
FILE_SHARE_READ, // share mode
NULL,