LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2011, 12:12 PM   #16
baxzius
Member
 
Registered: Jan 2010
Location: India
Distribution: ubuntu
Posts: 134
Blog Entries: 1

Rep: Reputation: 21

Insert your USB pen drive. Let it get detected and mounted. Open Terminal. Type The Following commands
1. dmesg |tail –> here the ‘|’ key is the pipe, ie, the key before the backspace key(the upper one, so press shift)
You’ll get something like

bripal@puredyne:~$ dmesg |tail
[ 9921.681164] sda: Write Protect is off
[ 9921.681174] sda: Mode Sense: 23 00 00 00
[ 9921.681178] sda: assuming drive cache: write through
[ 9921.709138] SCSI device sda: 4030464 512-byte hdwr sectors (2064 MB)
[ 9921.720951] sda: Write Protect is off
[ 9921.720963] sda: Mode Sense: 23 00 00 00
[ 9921.720967] sda: assuming drive cache: write through
[ 9921.721225] sda:
[ 9921.727896] sd 0:0:0:0: Attached scsi removable disk sda
[ 9921.744187] sd 0:0:0:0: Attached scsi generic sg0 type 0
Note the terms in bold. In your system it will be different, maybe sdb or something. Whatever it may be, make sure to substitute it in the commands below, else your hard disk may get formatted.

2. Unmount your pen drive by using
sudo umount /dev/sda (In your case, please substitute sda with the appropriate device, listed above.

3. use the mkfs.vfat command to format to FAT32 filesystem, or mkfs.ext3 to format to ext3 filesystem
sudo mkfs.vfat -n ‘Label’ -I /dev/sda Replace Label with the name you want the pen drive to have.

4. That’s it! When done formatting, you’ll be returned to the prompt
bripal@puredyne:~$ mkfs.vfat -n ‘bripal’ -I /dev/sda
mkfs.vfat 2.11 (12 Mar 2005)
bripal@puredyne:~$

Remove and insert the pen drive to have mounted again!
 
Old 07-11-2011, 12:24 PM   #17
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
@OP
Please note that the above will destroy all data on the usb.

Kind regards
 
0 members found this post helpful.
Old 07-11-2011, 12:36 PM   #18
baxzius
Member
 
Registered: Jan 2010
Location: India
Distribution: ubuntu
Posts: 134
Blog Entries: 1

Rep: Reputation: 21
ofcourse, i just trying to follow the title of this post.
read man!
 
Old 07-11-2011, 12:39 PM   #19
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Since you're being coached to use a shell commandline, and since
Quote:
mounting of local partitions is automatic and the standard place for it is in the /media directory
try first:
Code:
ls -las /media
If your files are there, you should be able to see them. Why they don't show up in your desktop tool is a mystery. Are they in the root of the flash drive, or in subdirectories?

Also note that there is a fair chance that your main hard disk is /dev/sda. PROCEED WITH CAUTION! On second thought, /dev/sda is a block device, not a partition, so you probably can't make a filesystem on it. Just make sure you don't format and existing hard disk partition.

--- rod.

Last edited by theNbomr; 07-11-2011 at 12:43 PM.
 
Old 07-11-2011, 12:40 PM   #20
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
Originally Posted by baxzius View Post
ofcourse, i just trying to follow the title of this post.
read man!
From the OP
Quote:
So, how do I access the files without deleting them, if that's possible?
Kind regards
 
Old 07-11-2011, 04:06 PM   #21
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by baxzius View Post
Insert your USB pen drive. Let it get detected and mounted. Open Terminal. Type The Following commands
1. dmesg |tail –> here the ‘|’ key is the pipe, ie, the key before the backspace key(the upper one, so press shift)
You’ll get something like

bripal@puredyne:~$ dmesg |tail
Note the terms in bold. In your system it will be different, maybe sdb or something. Whatever it may be, make sure to substitute it in the commands below, else your hard disk may get formatted.
Please read and understand the OP's question before answering. They already said they don't want to lose the data. And that command won't work, since it'll only give you the last few lines of the dmesg file. If the device was present at boot time, it may be far up in the file, and not visible in the last few lines. To see anything it's doing when you introduce a new device, it's easier to clear it with "dmesg -c", then insert the device, and run "dmesg" again. That gives you EVERYTHING related to just that device, and how the system sees it.
Quote:
2. Unmount your pen drive by using
sudo umount /dev/sda (In your case, please substitute sda with the appropriate device, listed above.
The OP isn't using a pen drive, but a memory stick, and they already said they don't know about Linux or how to determine what that device is mounted as.
Quote:
3. use the mkfs.vfat command to format to FAT32 filesystem, or mkfs.ext3 to format to ext3 filesystem
sudo mkfs.vfat -n ‘Label’ -I /dev/sda Replace Label with the name you want the pen drive to have.
..which will probably fail, since going by these instructions, the OP won't have created a partition to format, and will be trying to format a DEVICE, not a filesystem. The correct command would be "mkfs -t <filesystem type> /dev/sdxx".
Quote:
4. That’s it! When done formatting, you’ll be returned to the prompt
bripal@puredyne:~$ mkfs.vfat -n ‘bripal’ -I /dev/sda
mkfs.vfat 2.11 (12 Mar 2005)
bripal@puredyne:~$

Remove and insert the pen drive to have mounted again!
...only if the OP has automount enabled on that device.

OP if you get an icon somewhere when you plug that device in, the best thing I could suggest is just to copy all the files off, to make sure you've got them saved. Doing so from another computer would be prudent as well, perhaps one you know better. At times, Linux can be daunting when you're getting started, but the important thing is to make sure your data is saved.

Another thing to try would be to put the card into an external card reader, which you could attach to a USB port on any computer. Any 'gotchas' with a memory card slot would be taken out of the picture, and you'd just see it as another USB storage device.
 
Old 07-11-2011, 06:15 PM   #22
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
The OP isn't using a pen drive, but a memory stick
Okay, so I must have been living under a rock. What is the difference? I guess the OP could be talking about something like a SD flash card, which I've never heard called a memory 'stick', but even so, it behaves pretty much the same, especially if you read it with an external USB card reader. In any case, the result of the command 'lsusb' might be instructive.

--- rod.

Last edited by theNbomr; 07-11-2011 at 06:17 PM.
 
Old 07-11-2011, 07:12 PM   #23
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
If it is a sdhc card it may be his card reader. I have a 2 year old laptop that I had to buy an external usb to read the sdhc cards.
 
Old 07-12-2011, 09:48 AM   #24
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by theNbomr View Post
Okay, so I must have been living under a rock. What is the difference? I guess the OP could be talking about something like a SD flash card, which I've never heard called a memory 'stick', but even so, it behaves pretty much the same, especially if you read it with an external USB card reader. In any case, the result of the command 'lsusb' might be instructive.

--- rod.
LarryWebb got it. Sony does make an item called a MemoryStick, which is essentially an SD card in a different wrapper, with 'protection' on it. I've got slots in my laptop which are designed for both. Dmesg output for putting a card in the slot is different than using an external reader. Since the OP didn't mention a card reader, I'm assuming they mean a card slot, until the OP posts differently.

Also, the card in the slot gives me a device of /dev/mmcblk, with filesystems of /dev/mmcblk01, etc. In a card reader, it shows up as /dev/sdb1.

Last edited by TB0ne; 07-12-2011 at 09:56 AM.
 
Old 07-13-2011, 01:57 PM   #25
bripal
LQ Newbie
 
Registered: Jul 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Yes, I'm sure. There is memory used up on the stick, and that only happened when I transferred pictures over to the stick. I can try to put some more on, just to see what happens. I didn't have a problem transferring pics onto the stick through Linux before...it was just this time, for some reason.
 
Old 07-13-2011, 05:30 PM   #26
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Did you install testdisk or see if testdisk is already installed?
 
  


Reply



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
format my flash memory stick faizlo Linux - Hardware 5 08-03-2009 09:10 PM
USB memory stick - badblocks - how to format? mazzo Linux - Hardware 6 10-29-2008 12:26 AM
Two USB memory devies (stick memory/jump drive) one works one not Mark_in_Hollywood Linux - Hardware 5 05-20-2008 07:35 PM
format memory stick Tapasi Linux - Newbie 3 02-08-2008 07:34 AM
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 05:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:47 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration