LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 06-01-2009, 08:26 PM   #1
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Rep: Reputation: 15
Exclamation My Kingston DT 101 II 2GB infected by autorun.inf & gi2ky.exe and becom read-only!!


Hi,
Just like I said in the subject, and it isn't just in Linux, but in Windows XP too! I tried to turn off the write protection by "hdparm -r 0 /dev/sdc1" and "blockdev --setrw /dev/sdc1" but it still read-only file system, even if I try to format it...
for more information:
dmesg
Code:
usb 1-8: new high speed USB device using ehci_hcd and address 38
usb 1-8: configuration #1 chosen from 1 choice
scsi40 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 38
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 40:0:0:0: Direct-Access     Kingston DT 101 II        PMAP PQ: 0 ANSI: 0 CCS
sd 40:0:0:0: [sdc] 3966976 512-byte hardware sectors: (2.03 GB/1.89 GiB)
sd 40:0:0:0: [sdc] Write Protect is on
sd 40:0:0:0: [sdc] Mode Sense: 23 00 80 00
sd 40:0:0:0: [sdc] Assuming drive cache: write through
sd 40:0:0:0: [sdc] 3966976 512-byte hardware sectors: (2.03 GB/1.89 GiB)
sd 40:0:0:0: [sdc] Write Protect is on
sd 40:0:0:0: [sdc] Mode Sense: 23 00 80 00
sd 40:0:0:0: [sdc] Assuming drive cache: write through
 sdc: sdc1
sd 40:0:0:0: [sdc] Attached SCSI removable disk
sd 40:0:0:0: Attached scsi generic sg3 type 0
cat /etc/fstab
Code:
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't 
# needed; notail increases performance of ReiserFS (at the expense of storage 
# efficiency).  It's safe to drop the noatime options if you want and to 
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>			<mountpoint>	<type>		<opts>		<dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1		/boot		ext3		noauto,noatime	1 2
/dev/sda5		/		ext3		noatime		0 1
/dev/sda6		none		swap		sw		0 0
/dev/sda2               /home           ext3            defaults        0 2
/dev/sda7               /tmp            ext3            defaults        0 2
/dev/sda8               /var            ext3            defaults        0 2
/dev/sda9               /usr            ext3            defaults        0 2
/dev/cdrom		/mnt/cdrom	auto		noauto,ro	0 0
/dev/sdc1               /mnt/usbkey     auto            defaults,noauto,user 0 0
#/dev/fd0		/mnt/floppy	auto		noauto		0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for 
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm			/dev/shm	tmpfs		nodev,nosuid,noexec	0 0
PS: There is no hardware switch on my usb

Last edited by YassBoss; 06-02-2009 at 05:31 AM.
 
Old 06-01-2009, 09:48 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Hi, Welcome to LQ. With over 3 million posts, many questions have been answered.

you may get a faster answer by using the fantastic search function here at LQ.

One thing I see that does not make sense to me is the line... from fstab,
Quote:
/dev/sda1 /mnt/usbkey auto defaults,noauto,user 0 0
would conflict with the first statement from the same file...
Quote:
/dev/sda1 /boot ext3 noauto,noatime 1 2
Change the usbkey to point to the directory(absolute address) where it is stored.

Probably sdc1 as you mention above.

The /mnt/"directory-name" must exist,

If the system does not create it for you, mkdir for your self.

To save changes to this file you need to be root,

I hope that helps.

regards Glenn

Last edited by GlennsPref; 06-01-2009 at 09:49 PM.
 
Old 06-02-2009, 05:30 AM   #3
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Hi, sorry for that, but it's not working any way!
I'm going to edit the post right now
Thanks

Last edited by YassBoss; 06-02-2009 at 09:15 AM.
 
Old 06-02-2009, 12:21 PM   #4
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Any other idea??
 
Old 06-02-2009, 12:50 PM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,008

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
Quote:
I'm going to edit the post right now
Please don't do that: it makes these threads really difficult to follow. Just explain what the error was, or repost the correct output.
Quote:
Any other idea??
How is /dev/sdc1 formatted? Your fstab has it listed as "auto" which is not at all helpful.
 
Old 06-02-2009, 02:10 PM   #6
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Hi!
It's formated in fat16, I tried to write vfat in fstab but the problem still the same..
 
Old 06-02-2009, 02:50 PM   #7
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Do you have important data on it ? If not, zero it:

Code:
dd if=/dev/zero of=/dev/sdc
 
Old 06-02-2009, 03:18 PM   #8
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
I dont care about the content, so I tried your solution but:
Code:
dd: opening `/dev/sdc1': Read-only file system
Other solutions please...
 
Old 06-02-2009, 03:19 PM   #9
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
So you ran it on '/dev/sdc' right ? not '/dev/sdc1' ?
 
Old 06-02-2009, 04:13 PM   #10
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Both of them!
 
Old 06-02-2009, 09:40 PM   #11
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Hi, that is all I have really, the only other things...

1. Mount the flash drive in your home dir. Never tried that with a flashdrive, but

It works for other partitions I want access to, I set up /home/glenn/local/ .....

And mount all the other partitions here, as well as the other os's on this box.

2. you might need to be root to dd the drive.

3. Make sure the drive, is formatted fat16, and Has no hidden files,

like an encryption program (oem) or backup.

.... hope that helps.
 
Old 06-02-2009, 10:27 PM   #12
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
This may seem like a silly question, but does the drive have a write protect switch on it and is it on or off?
 
Old 06-03-2009, 06:57 AM   #13
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by GlennsPref View Post
Hi, that is all I have really, the only other things...

1. Mount the flash drive in your home dir. Never tried that with a flashdrive, but

It works for other partitions I want access to, I set up /home/glenn/local/ .....

And mount all the other partitions here, as well as the other os's on this box.

2. you might need to be root to dd the drive.

3. Make sure the drive, is formatted fat16, and Has no hidden files,

like an encryption program (oem) or backup.

.... hope that helps.
Sorry, it still read-only...
Is there a way to remove the 'autorun.inf' even if it's write protected?

Quote:
This may seem like a silly question, but does the drive have a write protect switch on it and is it on or off?
No, I can't find a switch on it!
 
Old 06-03-2009, 07:17 AM   #14
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Hi, once the system has laoded and everything is settled, look in...

/etc/mtab this file lists the currently mounted filesystems/partitions.

You may find out more about the drive here.

I have tried msdos, fat16 and auto.

These have worked for me....
Code:
/etc/fstab entries (at some time, but not together)....
# Entry for /dev/sdd1 :
UUID=19B0-35D4 /media/NOKIA vfat umask=0,user,noatime,flush 0 0

#Entry for  /dev/sdd1 :
UUID=19B0-35D4 /media/nokia vfat fat=16,defaults,user,nosuid,noauto 0 0

#Entry for  /dev/sdd1 :
UUID=19B0-35D4 /media/nokia msdos defaults,fat=16,user,nosuid,noauto 0 0
Notice they all have "user" access.

Some of the args in fstab when changed may negate other args.

man fstab
Quote:
DESCRIPTION
The file fstab contains descriptive information about the various file systems.
fstab is only read by programs, and not written; it is the duty of the system admin‐
istrator to properly create and maintain this file. Each filesystem is described on
a separate line; fields on each line are separated by tabs or spaces. Lines starting
with '#' are comments. The order of records in fstab is important because fsck(8),
mount(8), and umount(8) sequentially iterate through fstab doing their thing.
ref. http://unixhelp.ed.ac.uk/CGI/man-cgi?fstab+5
wiki http://en.wikipedia.org/wiki/Fstab

regards Glenn
 
Old 06-03-2009, 10:47 AM   #15
YassBoss
LQ Newbie
 
Registered: Jun 2009
Distribution: Gentoo Linux
Posts: 25

Original Poster
Rep: Reputation: 15
I've tried msdos, vfat and auto in fstab...

cat /etc/mtab

Code:
/dev/sdc1 /mnt/usb msdos ro,noexec,nosuid,nodev 0 0

/dev/sdc1 /mnt/usb vfat ro,noexec,nosuid,nodev 0 0

/dev/sdc1 /mnt/usb vfat ro,noexec,nosuid,nodev 0 0
So what I have to do now?
 
  


Reply

Tags
drive, readonly, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Thumbdrive Win32/Linux Encrypt & Stop Write to autorun.inf jago25_98 Linux - Hardware 1 06-01-2009 09:14 AM
autorun.exe and *.exe for linux eutalia2000 Linux - Newbie 3 12-23-2008 06:31 AM
Autorun a exe file when ubuntu boots. ASTRAPI Linux - Newbie 4 09-28-2007 07:02 PM
How to write an autorun.inf file Digital Surgeon Programming 6 04-04-2006 03:46 PM
SETUP.EXE/autorun.exe don't run in wine mst3kman Linux - Games 3 01-22-2006 02:20 PM


All times are GMT -5. The time now is 08:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration