Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
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.)
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.
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!
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
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".
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?
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..."
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.