LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-12-2016, 01:42 AM   #1
nomko
Member
 
Registered: Feb 2011
Location: The Netherlands
Distribution: Linux Mint 17.2
Posts: 115

Rep: Reputation: 21
Question USB memory stick issue


Hi all,

I've been using Linux Lite (LL) for a while which did not fully satisfied me. But when i used LL i create some bootable USB memory sticks with other distro's installed on the stick.

But now i'm using Deepin Linux and i want to use the memory sticks but now i run to some issues like i can't format my USB sticks, for some reason i have no root access to my sticks. Under Windows it happened that i was able to format a stick, install a distro (Elementary OS) using unetbootin (version unetbootin-windows-625) but at home it did not booted into Elementary but Linux Lite (very strange).

If i use Gparted, i cannot remove or edit any partition written on the USB memory stick. Gparted even shows that there are no partitions written and that i should create one although the USB stick has been written on and does have a partition?????

So, what is going on here? I have 4 USB memory sticks, different brands/models and they appear to have the same issues.

Any help/advise/hint will be very much appreciated!
Thanks!
nomko
 
Old 07-12-2016, 01:58 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,356

Rep: Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332
On your own system you should have root or sudo set up.
Users can write on dish disks they mount if
  1. The usb disk has a line in fstab and is mounted with the user(s) option
  2. The user may also need appropriate group membership

Are those conditions met? Man fstab & man group add are your friends
 
Old 07-12-2016, 11:01 AM   #3
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,976
Blog Entries: 33

Rep: Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467
nomko,

An alternative route is as follows.

Assuming that you have the .iso files for the 4 Linux distros on your Desktop (or you can download them there).

Run the below commands to format each USB drive to FAT32 file system from terminal,

Code:
sudo su
fdisk -l
This helps to discover your USB drive, which MAY be /dev/sdc (example only).

Then unmount the device:
Code:
umount /dev/sdc
Format device to FAT32:
Code:
mkdosfs -F 32 -I /dev/sdc
This example uses the .iso file for Linux Mint 18 MATE 64 bit.

Create a bootable USB flash drive.

Code:
cd Desktop

sudo dd if=/home/nomko/Desktop/linuxmint-18-mate-64bit.iso of=/dev/sdc oflag=direct bs=1048576
If all goes well, you should after a few minutes, see output similar to this:

Code:
1557+1 records in 
1557+1 records out 
1632927744 bytes (1.6 GB) copied, 396.237 s, 4.1 MB/s
This article on how to format a USB drive may be helpful:

http://askubuntu.com/questions/22381...sb-flash-drive

Last edited by beachboy2; 07-12-2016 at 11:05 AM.
 
Old 07-12-2016, 03:55 PM   #4
nomko
Member
 
Registered: Feb 2011
Location: The Netherlands
Distribution: Linux Mint 17.2
Posts: 115

Original Poster
Rep: Reputation: 21
Quote:
On your own system you should have root or sudo set up.
I have root/sudo access but not sure how to use it on my usb stick.

Quote:
[*]The user may also need appropriate group membership
how to check this?
 
Old 07-12-2016, 04:17 PM   #5
nomko
Member
 
Registered: Feb 2011
Location: The Netherlands
Distribution: Linux Mint 17.2
Posts: 115

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by beachboy2 View Post
nomko,

An alternative route is as follows.

(.........)
Heee beachboy, this might work:

root@MSI-GE70-2PE:/home/nomko# sudo dd if=/home/nomko/Bureaublad/linuxmint-18-cinnamon-64bit.iso of=/dev/sdd oflag=direct bs=1048576
1619+1 records gelezen
1619+1 records geschreven
1697906688 bytes (1,7 GB, 1,6 GiB) copied, 350,608 s, 4,8 MB/s


Now rebooting with the USB stick connected.
 
Old 07-12-2016, 04:20 PM   #6
nomko
Member
 
Registered: Feb 2011
Location: The Netherlands
Distribution: Linux Mint 17.2
Posts: 115

Original Poster
Rep: Reputation: 21
Beachboy, your instruction worked!

Just 1 thing: i ran the command umount /dev/sdd (in my case it is /dev/sdd) but i got a message in return saying that the drive was already unmounted (???)
Weird but okay, everything else worked!

Thanks!
 
Old 07-12-2016, 05:11 PM   #7
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,976
Blog Entries: 33

Rep: Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467
Smile

nomko,

Glad to hear that you have fixed things.

Sometimes the drive is already unmounted, but you need to use the umount command just to make certain.

The subsequent commands above will not work on a mounted drive.

Please go to your original post, click on the Thread Tools tab at the top and then click on Mark this thread as solved.
 
Old 07-13-2016, 12:49 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,356

Rep: Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332
To use root, simply type 'su' and the system prompts for the root password. Then simply type root commands in that shell. Alternatively 'su -'gives a shell as if you log in as root.

'exit' returns to the user.


Sudo is lazier if set up. Simply precede your command needing privileges with sudo, e.g.
Code:
sudo fdisk - l
lists partitions on visible drives.

For group membership, run
Code:
cat /etc/group | grep <username>
On most distros there is a disk group, and your user should be in that. To add him, use
Code:
usermod  -aG <groupname> <username>

Last edited by business_kid; 07-13-2016 at 12:50 AM.
 
Old 07-17-2016, 07:12 AM   #9
nomko
Member
 
Registered: Feb 2011
Location: The Netherlands
Distribution: Linux Mint 17.2
Posts: 115

Original Poster
Rep: Reputation: 21
Okay,

i made a very hugh mistake here.


I accidentally formatted AND installed elementary Loki Beta on my 500 GiB external disc which should not be happen/done!!


HOW CAN I REVERT THIS CHANGE? I NOW MISS IMPORTANT FILES!!!

thanks!

Last edited by nomko; 07-17-2016 at 07:28 AM.
 
Old 07-17-2016, 09:04 AM   #10
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,976
Blog Entries: 33

Rep: Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467
nomko,
Quote:
I made a very huge mistake here.
Unfortunately, I have to agree with you and this is why there are so many regular warnings posted on LQ forums to BACKUP YOUR DATA.

I think your data is non-recoverable since you have not only formatted the drive but also installed Elementary OS.

Shutdown your computer and have a close look at this:
https://help.ubuntu.com/community/DataRecovery

Create an image of the 500GB hard drive and then disconnect that drive.
Make a copy of this image file to another drive of sufficient size.
Only work on the copy. Do NOT touch the original 500GB drive.

Gnu ddrescue may be able to help, but I think it is very unlikely:
https://www.gnu.org/software/ddrescue/ddrescue.html

Differences:
http://askubuntu.com/questions/21157...-and-dd-rescue

Last edited by beachboy2; 07-17-2016 at 09:05 AM.
 
Old 07-17-2016, 01:42 PM   #11
nomko
Member
 
Registered: Feb 2011
Location: The Netherlands
Distribution: Linux Mint 17.2
Posts: 115

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by beachboy2 View Post

Create an image of the 500GB hard drive and then disconnect that drive.
How can i create an imgae of the 500 GB drive?

Quote:
Originally Posted by beachboy2 View Post

Make a copy of this image file to another drive of sufficient size.
Only work on the copy. Do NOT touch the original 500GB drive.
I understand the meaning of creating a copy and work with the copy.

Which tool to use here to try to recover some files?

Quote:
Originally Posted by beachboy2 View Post
Gnu ddrescue may be able to help, but I think it is very unlikely:
https://www.gnu.org/software/ddrescue/ddrescue.html
I should try this tool then?
 
Old 07-17-2016, 01:51 PM   #12
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
Correct me if I'm wrong, but ddrescue is to rescue corrupted data. This data was simply overwritten, yes?

To grab files that have been "erased" back from the void, try http://www.cgsecurity.org/wiki/PhotoRec (it does more than photos, despite its name) or scalpel https://github.com/sleuthkit/scalpel
 
Old 07-18-2016, 02:48 AM   #13
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,976
Blog Entries: 33

Rep: Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467
I have successfully used PhotoRec.

There is also R-Linux (not used personally):

http://www.r-tt.com/free_linux_recovery/
 
Old 07-18-2016, 06:05 AM   #14
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
r-Linux is pretty good. But I hold little hope for recovery under the circumstances.
 
Old 07-18-2016, 08:57 AM   #15
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,976
Blog Entries: 33

Rep: Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467Reputation: 1467
Quote:
r-Linux is pretty good. But I hold little hope for recovery under the circumstances.
Agreed.
 
  


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
HAL automount permissions differs between USB HD and USB memory stick Olaus Slackware 5 06-28-2010 06:34 PM
Two USB memory devies (stick memory/jump drive) one works one not Mark_in_Hollywood Linux - Hardware 5 05-20-2008 07:35 PM
*** USB external hard drive and USB memory stick linux_2007_ Linux - General 1 07-17-2007 04:20 PM
USB memory, Compact Flash, Memory Stick energiza Linux - Hardware 2 08-22-2006 09:29 PM
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 - Hardware

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