My friend gave me a pen drive with regsvr.exe, autorun.inf and “New
Folder.exe” on it. I think it is a virus and he said he was unable to
format it. I tried to fdisk it using
fdisk /media/sdb1
However, there is an error mesasage as follows:
last_lba(): I don’t know how to handle files with mode 40500
Unable to read /media/sdb1
I tried to take ownership of the files but even that doesn’t work.
Help me format the pen drive so that we can use it again.
I would try to use a partitioning tool to delete the partition. Then create a new one. There is one in Yast, or install gparted, it has an easy GUI interface. Just be sure to note what format it is currently in before deleting it so you will know what to reformat it to.
From a command line prompt, as the root user, run:
dd if=/dev/zero of=/dev/sdb
Before running this command, be aware of the following:
Every partition that happens to be in the usb device must be
unmounted
The parameter /dev/sdb must be replaced by the one in your system, eg, that used by the kernel to talk to the device.
Be careful with what you type here…you don’t want to destroy the data in other disks, do you?
The command not only will wipe the virus: it will destroy every bit of data in the device, even the partition table.
Once it is completed, you can use parted or fdisk to create partitions in it.
Once the partitions are created, you probably will have to use the command mkfs -t vfat /dev/sdb1 to build a fat32 file system on it.
For a ntfs fs, use mkfs -t ntfs /dev/sdb1 instead
Double check that you have the package dosfstools installed.
>
> I would try to use a partitioning tool to delete the partition. Then
> create a new one. There is one in Yast, or install gparted, it has an
> easy GUI interface. Just be sure to note what format it is currently in
> before deleting it so you will know what to reformat it to.
>
>
I had tried that some time before. What I did not like is that it added a
line to /etc/fstab.
>> I would try to use a partitioning tool to delete the partition. Then
>> create a new one. There is one in Yast, or install gparted, it has an
>> easy GUI interface. Just be sure to note what format it is currently in
>> before deleting it so you will know what to reformat it to.
>>
>>
> I had tried that some time before. What I did not like is that it added a
> line to /etc/fstab.
Only if you define a mount point, which is not a requirement.
The Yast partitioner should do the job nicely.
Just unmout the partitions manually, beforehand.
–
The sand remembers once there was beach and sunshine
but chip is warm too
– haiku from Effector Online, Volume 1, Number 6
> On 2008-08-02, Cross_AM <Cross_AM@no-mx.forums.opensuse.org> wrote:
>
>>> I would try to use a partitioning tool to delete the partition. Then
>>> create a new one. There is one in Yast, or install gparted, it has an
>>> easy GUI interface. Just be sure to note what format it is currently in
>>> before deleting it so you will know what to reformat it to.
>>>
>>>
>> I had tried that some time before. What I did not like is that it added a
>> line to /etc/fstab.
>
> Only if you define a mount point, which is not a requirement.
>
> The Yast partitioner should do the job nicely.
> Just unmout the partitions manually, beforehand.
>
>
Thank you. It worked.
Cross_AM wrote:
> fdisk /media/sdb1
I think your problem is that it has to be /dev/sdb, not /media/sdb.
I don’t know why you want to “format” the pen instead of just deleting
the files - would be way more safe for your own data, but if you like
to, why not. Just be careful to not mix up the device (sdb).