[SOLVED] USB sticks don't work afe r being used as I.S.O boot sticks
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.
USB sticks don't work afe r being used as I.S.O boot sticks
Hi All
I have loaded three separate distros over the last few months and each time the USB stick has been left with the available free space dramatically reduced (8 gig to 12 gig) or the the computer doesnt recognise that I have plugged the stick in at all.
I'll give more details, as best I can.
The first two were created using linux mint 17 and 17.1 respectively.
I think i made them from downloading the I.S.O files, then typing "usb" into the search bar and using the pre-installed USB boot disk creator, whatever that was called. I no longer have Mint installed so cant be sure of the name.
The third one was created on Ubuntu 14.10 and I'm pretty sure i used unetbootin to make that one.
the distros that were downloaded were all Mint and Ubuntu.
They all worked fine and installed with no problems, however when it came to using them a second time to do the same thing it just didn't work and if i was wanting to use them just for data they said that the amount of space that I had to deal with was much less than they originally had. I was unable to format them also.
The first time this happened I threw the USB away thinking it was faulty, however I kept the other two and trawled through youtube and forums and with my limited knowledge attempted to sort them.
now.... one of them says it has 1 gig of space when it is an 8 gig stick and the other doesn't register at all when I plug it in.
I have been using Ubuntu and Mint for about 2 years so am not totally green and use the computer a lot, however I have to confess that after attempting to sort a few minor problems when I first started using Linux I solve almost everything by backing up and re-booting from scratch. Everything shiny and new and anything I want re-loaded in an hour or so.
Sorry for the long winded waffle and probably poor terminology but thought it was best to give as much info as I could.
My question is, how can I revert these USB sticks back to how they were when i bought them?
Use partition editor like gparted and remove all partitions (from unmounted usb---gparted should do it with popup.) Make one single new one then format it to a format you wish to use.
Be sure you remove partitions from the usb drive! not any one that you need to keep.
Now if you can't access it by using gparted or other partition software then the next step would be to find out why it can't.
I have installed gparted but cannot see it in the list of partitions (see image...if it worked) the USB port seems to be ok as shown by the other open window, what would be my next step?
At the top right you have /dev/sda selected, this is your system drive. You need to change this to the USB device, whatever it happens to be (/dev/sdb, /dev/sdc, etc. it should be pretty easy to tell which one is the USB drive based on the total capacity and partition layout).
Last edited by suicidaleggroll; 06-21-2015 at 06:40 PM.
You can dd an iso image to the stick and make it bootable, but when you do this it overwrites the partition table and bootloader parts of the stick. You will need to recreate these to make it normal again.
Assuming no data of value on said stick.
$ cat /proc/partitions
(make sure you've got the device name right.)
(do the cat before and after inserting the usb storage device and notice the difference as the /dev/ name of the device)
(you can also check dmesg after a fresh insert)
# dd if=/dev/zero of=/dev/sdx bs=8M
(or dcfldd to see some feedback on progress)
# cfdisk /dev/sdx
(select dos partition type for small capacity devices like these)
(and setup at least one partition and set it to a microsoft type 0x0c? and save/write)
# mkfs.vfat -F FAT32 -n label /dev/sdx1
At which point the device should be roughly back to factory defaults. Bear in mind that these devices have limited number of writes and will fail to a read only mode in most cases, when they fail. Which is the time that you consider discarding them, or more sinister methods of disposal.
If you have a lot of time and extra space on other devices, you can make a copy of the entire stick before flashing it with linux. And restore that image to the device to make it normal again.
One advantage of routes like this one is that you can do it on any linux device with usb ports. Like a raspberry pi. Which leaves your daily driver free for other uses. Many means to an end. YMMV
I went for the gparted route first with it appearing simpler, selected the USB stick. From that point I basically winged it with the option that sounded the most likely to me. so "device" and "create partition table". MSDos was the only one that I had heard of so i went for that. That's as far as I got with that. I was lost at that point so went for the more in depth description by shadow7 and the scary world of Terminal.
I'll be honest, The first instruction seemed ok, I got that and could see the drive, after that I was lost and blundered my way as best I could.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,159
Rep:
From the command line:
Code:
sudo fdisk -l
Disk /dev/sda: 596.2 GiB, 640135028736 bytes, 1250263728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x313bf63a
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 31459327 31457280 15G 27 Hidden NTFS WinRE
/dev/sda2 * 31459328 31664127 204800 100M 7 HPFS/NTFS/exFAT
/dev/sda3 31664128 640784383 609120256 290.5G 7 HPFS/NTFS/exFAT
/dev/sda4 640784384 1250263039 609478656 290.6G 5 Extended
/dev/sda5 640786432 748054527 107268096 51.2G 7 HPFS/NTFS/exFAT
/dev/sda6 748056576 760344575 12288000 5.9G 82 Linux swap / Solaris
/dev/sda7 760346624 961824767 201478144 96.1G 83 Linux
/dev/sda8 * 1174818816 1195298815 20480000 9.8G 83 Linux
/dev/sda9 1195300864 1250263039 54962176 26.2G 83 Linux
...
Disk /dev/sdi: 3.8 GiB, 4022337024 bytes, 7856127 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd2fc87fe
Device Boot Start End Sectors Size Id Type
/dev/sdi1 2048 7856126 7854079 3.8G 83 Linux
Find the device ( in this instance its /dev/sdi1 ).
Run fdisk again but in interactive mode
Code:
sudo fdisk /dev/sdi
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
...
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
The 'm' command will list all available options we want o, n, p and w like so:
Code:
Command (m for help): o
Created a new DOS disklabel with disk identifier 0x0c0ba358.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-7856126, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-7856126, default 7856126):
Created a new partition 1 of type 'Linux' and of size 3.8 GiB.
Command (m for help): p
Disk /dev/sdi: 3.8 GiB, 4022337024 bytes, 7856127 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0c0ba358
Device Boot Start End Sectors Size Id Type
/dev/sdi1 2048 7856126 7854079 3.8G 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Just accept the defaults when creating a new partition by pressing 'RETURN', fdisk will exit after the 'w' command now just format the partition
Yes, by sdx I mean the /dev/ name for "YOUR" device. Also things prefixed with # are as root, so you'd likely prefix them with sudo under distros like ubuntu. Or sudo -s to become root and do less typing. Otherwise you get the permission denied errors as regular users are not trusted with formatting disks in most default configurations.
I've found that some people can only seem to master a gui. They may be great at it in fact. There are some people who started out and have mastered command line and may never see a gui. I can't tell from this user to know what is best for the user but it's my humble opinion that newbies respond better to a gui solution. They have been raised on it. Old farts like me never had a gui till they were 40.
Hopefully the OP will be helped by any of our suggestions. They are in fact free to decide and try and this is the place to learn.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,159
Rep:
I just think you know how to do basic stuff in both gui and cli, stuff like partitioning/formatting disks, adding/modifying users etc, these are just the sort of basic tasks that offten can only be done from the cli because of the state the os is in, as an aside I use a gui for most things, I am not anti gui I was just offering an alternative solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.