Not able to remove virus from a pen drive


 
Thread Tools Search this Thread
Operating Systems Linux Not able to remove virus from a pen drive
# 1  
Old 03-10-2010
Not able to remove virus from a pen drive

Hello Friends,

My pendrive (FAT32 filesystem) consist of following files+viruses.

Code:
-rwxr-xr-x 1 chinmay root        0 2010-03-10 01:29 autorun.inf
dr-xr-xr-x 2 chinmay root     4096 2010-03-09 23:51 Docs
-rwxr-xr-x 1 chinmay root  4726162 2010-03-08 15:02 java_ee_sdk-5_03-javadocs.zip
-rwxr-xr-x 1 chinmay root 46191338 2008-03-20 18:18 jdk-1_5_0-doc.zip
-rwxr-xr-x 1 chinmay root 54898268 2008-03-20 18:25 jdk-6-doc.zip
drwxr-xr-x 2 chinmay root     4096 2010-03-09 17:41 jvm my notes
-rwxr-xr-x 1 chinmay root  1070753 2006-01-01 08:20 New Folder .exe
dr-xr-xr-x 3 chinmay root     4096 2010-03-10 01:29 recycler
-r-xr-xr-x 1 chinmay root  1070753 2006-01-01 08:20 regsvr.exe
-r-xr-xr-x 1 chinmay root   103781 2008-01-28 11:44 xo8wr9.exe


Am facing a problem while formatting my pendrive on Windows XP, it says unable to format. Then I used 'attrib' to change the properties of files, and then 'del' but still not able to remove them.

Then i tried to remove the same files on my linux (Fedora10, OpenSuse11.1) m/c, but still its not able to remove them, terminal hangs out while unmounting the drive.

On Fedora 12, It deletes all the files, unmounts the drive, but when i mount it again, it shows all the files. Smilie

- One thing i dont understand why linux is not able to remove these exe files.

Pls help.

Thanks in advance.

Last edited by pludi; 03-10-2010 at 08:27 AM.. Reason: code tags, please...
# 2  
Old 03-10-2010
try using fdisk on linux to remove the partition on the device and recreate a new partition, then change the partition type to vfat and format.
# 3  
Old 03-11-2010
Code:
[root@localhost ~]# fdisk /dev/sdb 

Command (m for help): p

Disk /dev/sdb: 4040 MB, 4040724480 bytes
125 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes
Disk identifier: 0x6f20736b

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   ?      100405      247697   570754815+  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(357, 116, 40) logical=(100404, 79, 11)
Partition 1 has different physical/logical endings:
     phys=(357, 32, 45) logical=(247696, 24, 51)
Partition 1 does not end on cylinder boundary.
/dev/sdb2   ?       21767      271577   968014120   65  Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(288, 115, 43) logical=(21766, 48, 47)
Partition 2 has different physical/logical endings:
     phys=(367, 114, 50) logical=(271576, 60, 42)
Partition 2 does not end on cylinder boundary.
/dev/sdb3   ?      241276      491086   968014096   79  Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(366, 32, 33) logical=(241275, 3, 30)
Partition 3 has different physical/logical endings:
     phys=(357, 32, 43) logical=(491085, 14, 39)
Partition 3 does not end on cylinder boundary.
/dev/sdb4   ?      372346      372354       27749+   d  Unknown
Partition 4 has different physical/logical beginnings (non-Linux?):
     phys=(372, 97, 50) logical=(372345, 119, 25)
Partition 4 has different physical/logical endings:
     phys=(0, 10, 0) logical=(372353, 14, 33)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

Then i have deleted all the partitions

Code:
Command (m for help): d
No partition is defined yet!

Command (m for help): p

Disk /dev/sdb: 4040 MB, 4040724480 bytes
125 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes
Disk identifier: 0x6f20736b

   Device Boot      Start         End      Blocks   Id  System


Command (m for help): v
7892039 unallocated sectors

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

No reponse, terminal hangs, ie. am not able to save/read partition table on usb drive...

I also tried mkfs command for create file system...

Code:
[root@localhost chinmay]# mkfs -V -t ext3 /dev/sdb 
mkfs (util-linux-ng 2.14.1)
mkfs.ext3 /dev/sdb 
mke2fs 1.41.4 (27-Jan-2009)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
247008 inodes, 986505 blocks
49325 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1010827264
31 block groups
32768 blocks per group, 32768 fragments per group
7968 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done                            
Creating journal (16384 blocks):


After this, No reponse, terminal hangs...

Pls help.....



Last edited by pludi; 03-11-2010 at 05:57 AM.. Reason: code tags, please...
# 4  
Old 03-11-2010
All your work in fdisk was wiped out when you just reformatted /dev/sdb directly. Smilie That device had no partitions at all, it was all just one big VFAT system, like an old-fashioned floppy. Which is why fdisk showed garbage, it was reading the filesystem itself instead of a partition table. /dev/sdb is the disk, /dev/sdb1 etc. would be partitions on that disk if it had any. You'd almost never see a hard drive without a partition table, but some flash drives still obnoxiously come formatted this way.

That said, you've got bigger problems. A virus would need supernatural properties to stop linux from formatting the drive. I think your flash drive's malfunctioning. It's locking up and not taking legitimate writes.

Last edited by Corona688; 03-11-2010 at 12:21 PM..
# 5  
Old 03-12-2010
Ooppsss... any ways thanks guys.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to mount USB pen drive?

Hiii, Please let me know the steps for mounting my USB pendrive in solaris 10 platform. Thanks & Regards, Bhargav P (5 Replies)
Discussion started by: bhargav90
5 Replies

2. SCO

Sco unix 5.0 copy file to pen drive

I have a server unix Sco 5.0 and copy some backup files to flopy drive using command "Tar", but i like copy this files to pen drive, is possible ? my know about Sco is less. Tks (1 Reply)
Discussion started by: ger2112
1 Replies

3. Red Hat

making pen drive bootable

Anyone can plz tell me how to make pendrive bootable.unetbootin dont have option for red hat (0 Replies)
Discussion started by: shamapraveen
0 Replies

4. SCO

how to access data in a pen drive in sco openserver 6

Does anybody know the commands to access the data from a pen drive in a SCO Openserver 6. What are the parameters to the mount command for accessing the USB port:confused: (9 Replies)
Discussion started by: jksah
9 Replies

5. Linux

How to Install Linux os from USB pen drive

can any body tell simple steps to install linux from pen drive (4gb) fat32 ( with out dvd rom ) (3 Replies)
Discussion started by: seshumohan
3 Replies

6. Shell Programming and Scripting

how to run a script when pen drive is inserted

Hi, I need to run a script whenever a pen drive is connected to my ubuntu machine. The script is to be run from local disk and with privileges of current user. How do I achieve this? Thanks. (1 Reply)
Discussion started by: friendlyweb
1 Replies

7. Filesystems, Disks and Memory

USB Pen Drive & Hard Disk

Hi Guys, I have an external USB Hard Disk Drive on which I have 3 partitions and it works fine under Windows XP but when I am using Red Hat Linux 5 I don't see any icon for this USB HDD. Also I am not able to browse my USB Pen Drive. However, I can use it under Mandrake Linux without any... (4 Replies)
Discussion started by: indiansoil
4 Replies

8. BSD

FreeBSD pen drive issue....

Hi there, I am using freebsd 7.0 and I am facing a lot of issues with it. The cd installed fine. I opted for the gnome desktop and tht too installed (though the refresh rates were wrong and the resloution got messed up). After some configurations the desktop was working fine. Then came the... (5 Replies)
Discussion started by: jedidiah
5 Replies

9. Debian

linux on 128MB pen drive?

hello, I want to install minimal linux on 128MB pen drive. distro is debian. what all should i need? (2 Replies)
Discussion started by: yogesh_powar
2 Replies

10. UNIX for Dummies Questions & Answers

USB pen drive support

Hello, I need information or tooling for using my USB pen drive (DANE-ELEC) in a unix environment. Until now I only get the "format window" in the unix machine but after giving OK for running the format, it never stops and I have to stop it manually. Seems that what I need is format my... (0 Replies)
Discussion started by: Argento73
0 Replies
Login or Register to Ask a Question