Monthly Archives: September 2011

11

How to mount a usb or micro sd card, when Linux does not automount

by

This is something I am asked by n00bs a lot. My Linux system doesn’t automount my USB or micro sd card / camera card, what do I do now?

(NOTE: You can usually tell an automounted device because it will have a mount point of

/media/volumelabel

First of all, like Douglas Adams said: Don’t panic!

The first thing you want to do, is to find out if Linux can first see the device? How? Easy.

1. The first thing we want to do, is see if Linux see’s the device? How? Easy! lsusb


lsusb

Sample lsusb output

nwayno@Homer:~$ lsusb
Bus 002 Device 003: ID 03f0:4211 Hewlett-Packard OfficeJet 7300 series
Bus 002 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 010: ID 0951:1603 Kingston Technology DataTraveler 1GB/2GB Pen Drive
Bus 001 Device 006: ID 0488:0022 Cirque Corp.
Bus 001 Device 004: ID 0bc2:3000 Seagate RSS LLC
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and sure enough the device I am looking for is present:

Bus 001 Device 010: ID 0951:1603 Kingston Technology DataTraveler 1GB/2GB Pen Drive

It is NOT mounted, but I know that Linux can see it.

2. The second step is to determine what the device is called. How do you do that? blkid. blkid will list all the block devices attached to a system. NOT necessarily mounted. We want ALL devices, so we do that as root. Be patient! This can take a couple of minutes (Your patience will be rewarded.)


sudo blkid

Sample blkid output

nwayno@Homer:~$ sudo blkid
[sudo] password for nwayno:
/dev/sda1: LABEL=”Homer699″ UUID=”12345AB567″ TYPE=”ntfs”
/dev/sda2: UUID=”4dac-408816aecd1e” TYPE=”swap”
/dev/sda3: LABEL=”homer” UUID=”4e75-985fd59115e4″ TYPE=”ext4″
/dev/sda4: LABEL=”waynohome” UUID=”bc4-4c34-9d7d-3f5a56d13″ TYPE=”ext4″
/dev/sdb1: LABEL=”BFDNTFS” UUID=”FC1687414″ TYPE=”ntfs”
/dev/sdb2: LABEL=”bfdlinux” UUID=”143-4c0-4db-a392-55fb94a0f” TYPE=”ext4″
/dev/sdd1: UUID=”7E-4CEC” TYPE=”vfat”
/dev/sdd2: UUID=”42062a-9f99-a4ec71894″ TYPE=”ext4″
nwayno@Homer:~$

Notice that all the devices on my system were listed. Both mounted and umounted.

So the guy I am looking for is /dev/sdd1

YOUR DEVICE MAY BE A DIFFERENT NAME.. Remember the device is STILL not mounted at this point.

We know that /dev/sdd1 is vfat which is pretty typical of micro-sd cards. They are almost always vfat.

3. We have a couple of choices on mounting the device. We can use the a system mount point /mnt or create one with mkdir. I’ll only show the mount with the system mount point, but it could easily be anything that you create. Remember that to Linux, a device is just a mount point.

4. So become root, and mount the device:


sudo mount -t vfat /dev/sdd1 /mnt

YOUR DEVICE MAY BE A DIFFERENT NAME.

Remember, only root can mount/unmount (umount) devices.

The -t tells us that the device is vfat (windows). We got that from the blkid command. If it’s not vfat, the output of blkid well tell us what the file structure is. Use man mount for more information.

/dev/sdd1 was also obtained from the blkid information, tells us to associate this device with the mount point that follows: /mnt.

5. To access you files, launch your file browser (I use nautilus and just navigate (Filesystem/mnt directory) or just do a a cd to the /mnt directory:

/mnt directory

And the contents of /mnt are:

contents of /mnt


cd /mnt

6. List the files:


ls

and you should get some output:

A6VWN4.pdf
aztcs.htm
budgeting
discovery
FNPACK
ubuntu_11.04.png
ubuntu_11.04_unity.png
unity_11_04.png
vsftpd.conf_25K

7. And how much space do you have left on that device?


df -h

the df command displays used and free space on the device:

Sample df -h output

nwayno@Homer:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 50G 23G 25G 48% /
none 934M 268K 933M 1% /dev
none 940M 1.5M 939M 1% /dev/shm
none 940M 344K 940M 1% /var/run
none 940M 4.0K 940M 1% /var/lock
/dev/sda4 834G 306G 486G 39% /home
/dev/sdb2 773G 397G 337G 55% /media/bfdlinux
/dev/sdb1 147G 90G 58G 61% /media/BFDNTFS
/dev/sdd1 975M 847M 128M 87% /mnt
nwayno@Homer:~$

YOUR DEVICE MAY BE A DIFFERENT NAME.

In my case I have used 847M, and have 128M free on a 975M device (/dev/sdd1 above or /mnt)

8. All done? Umount the device, and sync the output.


umount /dev/sdd1

YOUR DEVICE MAY BE A DIFFERENT NAME.


sync

sync flushes the buffers, writes any pending data to the drive, and avoids data loss!

Easy! Painless!

Wayno

2

What folder do you use to add music to a Samsung Restore?

by

No place on the internet, have I found the location to add your own music, to a Samsung Restore Cell Phone. Till now. While this is Linux oriented, the same location would be used in Windows.

It goes into the Downloads folder. (Yes. Spelled “Downloads” with a capital D!)

1. Copy your music from your source, to this folder. Yes you can have embedded folders. Mine is called: “The Moody Blues”

You can use nautilus to create the folder, or mkdir from the command line. In Windows, you would use the File Manager.

Virgin Mobile Music Folder

Virgin Mobile Music Folder Location


You will notice that my microsd is labelled WAYNOSVMFON. You can do this with gparted. Note that the microsd is formatted as vfat. Debian has some issues auto-mounting vfat partitions, so you may need to manually mount it.


sudo mount /dev/sdxx /mnt

where xx is the device name (hint: use sudo blkid to get that)

You will notice that when you use the media player, that a file in (yup, remember this is windows) is created called:

Virgin Mobile Music Key File

Virgin Mobile Music Key File

SamsungMusic_key.txt

The file seems to contain some random 4 digit number.

You may also notice a folder called “music” That’s NOT where you put the music. BUT, you will find the file: playlist.mdb Yup, that’s a Microsoft Database file.

Oops! Added an SONG you no longer want? Want to make it disappear? Sort of easy. This is how you do it from the phone itself.

1. Select the LEFT Menu button.

2. Go to Tools and Settings.

3. Select Tools.

4. Mass Storage.

5. File Manager.

6. Memory Card

7. Downloads folder.

8. Open the Folder that your music is in, then the sub-folder within that contains the song you to delete, and finally the song. Nope it will NOT let you just delete the folder, if it contains files. You must delete the contents of the folder, one at a time.

9. Options Button (right button)

10. Delete

Enjoy your music!

Wayno