LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-18-2016, 03:02 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Rep: Reputation: 176Reputation: 176
USB flash drive not being recognized


I had a Xubuntu live install file on a 8GB Crucial USB flash drive. When I plugged it in to my regular computer it wasn't recognized. (I just wanted to do some copying and pasting and had forgotten the Xubuntu file was on there.) So I opened Gparted and saw the Xubuntu file on the drive. So I deleted the entire drive and then formatted it ext3.

I put it back in the computer. Still not recognized.

I put it in my laptop and two icons appeared. One for the USB flash drive and one for the Xubuntu live install, which I thought had been deleted.

I know when I first looked at the USB drive in Gparted the flags were: boot, hidden.

Anyway, I put the USB drive back in my regular computer and opened Disks utility, where I was able to mount the drive.

When I double clicked on the drive I got screenshot 92.

When I checked properties I got screenshot 93.

Questions:
1) Why did the live Xubuntu stay on the drive when the entire drive was (supposedly) deleted in Gparted?

2) How do I get this back to a regular old USB drive?

Thanks.
Attached Thumbnails
Click image for larger version

Name:	Selection_092.png
Views:	147
Size:	27.4 KB
ID:	21810   Click image for larger version

Name:	Selection_093.png
Views:	130
Size:	46.8 KB
ID:	21811  
 
Old 05-18-2016, 04:07 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,973

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I don't see what you mean.

If you deleted the partition and made a new partition it will usually wipe out the remnants of grub or syslinux loaders which is what I get the feeling is the issue. Gparted has a way to put on a default mbr too I think that might cure it also.

Why are you using ext3?

Last edited by jefro; 05-18-2016 at 04:09 PM.
 
Old 05-18-2016, 08:46 PM   #3
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by jefro View Post
I don't see what you mean.

If you deleted the partition and made a new partition it will usually wipe out the remnants of grub or syslinux loaders which is what I get the feeling is the issue. Gparted has a way to put on a default mbr too I think that might cure it also.

Why are you using ext3?
My computer is getting snarky, jefro. Okay, I went back into Gparted and deleted the ext3 (and what's wrong with ext3--I thouoght that was optimal for xubuntu?) and made a new version in NTFS. Now the flash drive acts normal, but when I have the flash drive mounted and then open Gparted the flash drive icon disappears from the Desktop. Then I waas playing an audio file in Banshee and Xd out of the screen and the audio file kept playing.

And I've got the 'a new browser opens when I click on a tab' thread going too.

Like I said, snarky.

Thanks.
 
Old 05-19-2016, 01:41 PM   #4
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
So now even with the NTFS formatting when I put the USB flash drive into my laptop it populates two icons. One with the USB flash drive's name and the other with the Xubuntu live iso file. And then I can only mount one or the other.

This happened to me before too. It's like once a live file gets on the USB drive you can't get it off.
 
Old 05-19-2016, 02:42 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,675

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
I would delete the partition table and create a new one with new partition(s) and format as desired. This should "wipe" out the the Ubuntu live.

When you copy a live image its appears to be the size of the iso file which is smaller then the drives actual "physical" capacity. The easiest method to restore the drive to its actual size is to delete the partition table.

Last edited by michaelk; 05-19-2016 at 02:44 PM.
 
2 members found this post helpful.
Old 05-19-2016, 07:55 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,973

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
The reason I asked about ext3 may have been me overthinking it. Thought you need it for some interchangeability.

It's just me but I might be tempted to just use ext4 or ntfs.

I am pretty sure you have remnants of a loader. Do as I suggested or michaelk suggest should fix it.

It used to be that you had to run the HP usb tool to fix these but I doubt you need to.
 
Old 05-19-2016, 09:53 PM   #7
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by michaelk View Post
I would delete the partition table and create a new one with new partition(s) and format as desired. This should "wipe" out the the Ubuntu live.

When you copy a live image its appears to be the size of the iso file which is smaller then the drives actual "physical" capacity. The easiest method to restore the drive to its actual size is to delete the partition table.
Thanks Michael. But that's what I feel I've been doing. Here it is step-by-step.

1)Open Gparted
2)bring usb flash drive up and left click on it, highlighting it
3)Click on Partition in toolbar
4)Choose Delete
5)click on Apply
6)Click on Partition in toolbar
7)Click on New
8)Choose NTFS
9)name the drive
10)Click on "Add +"
11)Click Apply

It does the operation but the usb drive is nowhere to be found on the computer and the "mount" option in Gparted is greyed out.

I can only mount the USB flash drive thru the Disks Utility. I can only access the drive thru the File system via "media". Then I get to this file (I don't know what the X might signify) (see screenshot). And after the Gregg folder I get to the drive and can add things.

When I remove the drive and add it to my laptop, it shows two desktop icons. #1) the name I gave the drive #2) Xubuntu 15.10 i386 (which is the live bootable iso)

And there when I unmount the Xubuntu I can use the flash drive normally.

Am I doing something wrong? Because I have two USB flash drives that I've used for installations that are like this. Thanks.

AND when Gparted is open and I insert a USB flash drive it will indeed appear on Gparted when refreshed. However it appears nowhere on the computer, at least on the Desktop, like it normally does. But when I X out of Gparted the USB drive's icon appears on the Desktop.(This is a minor issue but I figured I'd mention it just in case it sheds any light on the other issue.)
Attached Thumbnails
Click image for larger version

Name:	Selection_094.png
Views:	33
Size:	22.5 KB
ID:	21825  
 
Old 05-20-2016, 06:41 AM   #8
smakoda
LQ Newbie
 
Registered: May 2016
Posts: 1

Rep: Reputation: Disabled
It turned out the usb-storage module was not being loaded at startup and so couldn't detect any USB drives.

To try it first, I inserted my usb, opened up the terminal and typed sudo modprobe usb-storage and it was detected.

To make the changes permanent, I edited the file /etc/modules as root and added the line usb-storage

My file now looks like this:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

usb_storage
lp
 
1 members found this post helpful.
Old 05-20-2016, 06:49 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,675

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Deleting the partition does not delete the MBR.

Using gparted select "Create New Partition Table", then create a partition using the entire free space and then format.
 
1 members found this post helpful.
Old 05-20-2016, 03:10 PM   #10
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by smakoda View Post
It turned out the usb-storage module was not being loaded at startup and so couldn't detect any USB drives.

To try it first, I inserted my usb, opened up the terminal and typed sudo modprobe usb-storage and it was detected.

To make the changes permanent, I edited the file /etc/modules as root and added the line usb-storage

My file now looks like this:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

usb_storage
lp

Thanks smakoda. I'm finding that when Gparted isn't activated, the USB flash drive mounts and unmounts and acts pretty normal, so I'll leave well enough for now, but I'll re-visit your solution if I keep having problems. Appreciate it. And welcome to Linux Questions!
 
Old 05-20-2016, 03:10 PM   #11
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by michaelk View Post
Deleting the partition does not delete the MBR.

Using gparted select "Create New Partition Table", then create a partition using the entire free space and then format.
Thanks. That did it.

I have some follow-up questions.

1) So this "create partition table" is obviously the best way to clear everything off the USB flash drive, but when would I use what I was doing in post #7?

2) Is the "partition table" the whole USB flash drive and a "partition" just one part of the USB drive? (Is that why it will say (for eg.) sdb1 ?)

Thanks.

Last edited by Gregg Bell; 05-20-2016 at 05:02 PM. Reason: follow-up questions
 
Old 05-20-2016, 07:15 PM   #12
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
The partition table is the area at the front of the disk that holds the information about the partitions, like how many, where they are, how big, etc.

With a MBR-partitioned disk (which it sounds like you have) the partition table and bootloader information are both stored in that reserved space at the beginning of the drive. So when you delete the partition, it doesn't remove any of the bootloader portion of the MBR, just the part that says that a partition is there.

I had something similar happen to one of my flash drives. I fixed it by zeroing out the first few kilobytes of the disk. (Wikipedia informs me that only the first 512 bytes really matter, but I like to make sure.

Code:
dd if=/dev/zero of=/dev/sdX bs=4k count=1
Replace /dev/sdX with your actual drive.

And before you run it, make ABSOLUTELY SURE that you're about to wipe the right drive. Check in Gpated, look back at the terminal, be 110 percent positive that you have the correct disk. (It could get really nasty really quickly if you wipe the wrong disk, like your main hard drive)

After you wipe it, refresh Gparted, and it will probably say something like "couldn't find partition table" which is exactly what you want. (You just wiped the partition table, you should hope that it doesn't find it if you wiped it!) It might prompt you to create a new partition table. If it does, select "msdos" and then proceed to create your new partition like usual.
If it doesn't prompt you to create a partition table, go to "Device" (along the top) and select "Create new partition table", then select "msdos".
 
1 members found this post helpful.
Old 05-20-2016, 08:41 PM   #13
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by maples View Post
The partition table is the area at the front of the disk that holds the information about the partitions, like how many, where they are, how big, etc.

With a MBR-partitioned disk (which it sounds like you have) the partition table and bootloader information are both stored in that reserved space at the beginning of the drive. So when you delete the partition, it doesn't remove any of the bootloader portion of the MBR, just the part that says that a partition is there.

I had something similar happen to one of my flash drives. I fixed it by zeroing out the first few kilobytes of the disk. (Wikipedia informs me that only the first 512 bytes really matter, but I like to make sure.

Code:
dd if=/dev/zero of=/dev/sdX bs=4k count=1
Replace /dev/sdX with your actual drive.

And before you run it, make ABSOLUTELY SURE that you're about to wipe the right drive. Check in Gpated, look back at the terminal, be 110 percent positive that you have the correct disk. (It could get really nasty really quickly if you wipe the wrong disk, like your main hard drive)

After you wipe it, refresh Gparted, and it will probably say something like "couldn't find partition table" which is exactly what you want. (You just wiped the partition table, you should hope that it doesn't find it if you wiped it!) It might prompt you to create a new partition table. If it does, select "msdos" and then proceed to create your new partition like usual.
If it doesn't prompt you to create a partition table, go to "Device" (along the top) and select "Create new partition table", then select "msdos".
Thanks maples for the explanation. It was very helpful. And thanks for the warnings.

When I want to completely wipe a disk and format it, is it always wise go the "Device">"Create Partition Table" route or are there ever times to go the "Partition">"Delete" route? And it is "Create Partition Table" and not "Create new partition table," right?

Thanks.
 
Old 05-22-2016, 10:45 AM   #14
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
In most cases, I usually just delete the partition. Unless there's something extra stored there (like what's on your drive right now) creating a new partition table and deleting all the partitions should effectively accomplish the same thing.

Keep in mind that creating a new partition table will remove ALL partitions. So if you have a flash drive with 2 partitions, and you want to remove and re-format only one, then you can NOT create a new partition table.

And yes, the correct menu option is "Device" -> "Create Partition Table..."
 
1 members found this post helpful.
Old 05-22-2016, 11:04 AM   #15
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You can create filesystem on raw device instead of partitioning it. mkfs.ext4 /dev/sdb will create one single filesystem on sdb and wipe out previous partition table in process.
 
1 members found this post helpful.
  


Reply


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
[SOLVED] USB flash drive formatted with mkntfs doesn't get recognized by HDTV earthw0rmjim Linux - Software 1 09-06-2014 04:12 AM
Cloning bootable USB flash drive onto larger flash drive - best method? cilbuper Linux - General 5 02-26-2014 09:51 AM
USB Flash Drive Not Recognized cdnm Linux - Hardware 1 11-16-2009 09:31 PM
Usb flash drive not recognized americulchie Linux - Newbie 4 10-16-2009 03:45 PM
USB Flash Drive not recognized on Sony with Mandrake 10.2 philosophe Linux - Laptop and Netbook 0 05-13-2005 04:10 PM

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

All times are GMT -5. The time now is 04:14 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