# Persistent Ubuntu LiveUSB unable to mount drives



## Sapphire Dragon (Nov 2, 2012)

Hi, I've searched around for many possible solutions to this, to no avail. So I'm posting now for some direct help if possible.
I've installed Ubuntu 12.04 onto an 8GB flash drive with persistence as a LiveUSB. Whenever I try to access any other hard drive (both my computer's and my external) it always gives me the error message "Error mounting: mount exited with exit code 21: mount: according to mtab, /dev/* is already mountetd on /media/*". Whenever I try to access it through /media/, it tells me I don't have the necessary permissions to.

I've gone through Disk Utility with the same result, tried gksudo nautilus (navigating to the drive in /media/ just shows nothing), and tried shutting down/rebooting several times. Nothing works. I had also installed another Ubuntu 12.04 on my computer in Win7 through Wubi, and rebooted to that installation to unmount the drive (which mounted/unmounted with no problems), but eventually uninstalled that one thinking that it might still passively be the problem. No good. I'm stumped.

Some various command line results, if you wanted them:


```
[email protected]:~$ sudo fdisk -lu

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0x99fd87a4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      409599      203776    7  HPFS/NTFS/exFAT
/dev/sda2          409600   935329791   467460096    7  HPFS/NTFS/exFAT
/dev/sda3       935329792   976560127    20615168    7  HPFS/NTFS/exFAT
/dev/sda4       976560128   976771119      105496   82  Linux swap / Solaris

Disk /dev/sdb: 8075 MB, 8075120640 bytes
255 heads, 63 sectors/track, 981 cylinders, total 15771720 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
Disk identifier: 0x0f482339

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63    15771719     7885828+   c  W95 FAT32 (LBA)

Disk /dev/sdc: 1000.2 GB, 1000170586112 bytes
255 heads, 63 sectors/track, 121597 cylinders, total 1953458176 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
Disk identifier: 0x00042ada

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048  1953458175   976728064    7  HPFS/NTFS/exFAT
[email protected]:~$ cat /etc/mtab
cat: /etc/mtab: Input/output error
```


----------



## hal8000 (Dec 23, 2006)

Boot from your live USB disk and post the output of following commands:


cat /etc/fstab

mount


( Its not the mount table, (mtab) but the filesystem table (fstab) that defines which partitions and file systems get mounted. Mtab is dynamic and will be altered when a device or file system is mounted or unmounted. )


----------



## Sapphire Dragon (Nov 2, 2012)

Now it seems like my whole persistence file is the problem.

I tried to boot it and it brings up the ubuntu loading screen after a few command screen flashes, but then after a few seconds it goes back to a command line screen awaiting input after a long list of errors. Initially I thought the installation may have corrupted so I used Lili (same program I used before) to format and reinstall a LiveUSB, then deleted the new/replaced my old casper-rw file, safely ejected the usb, removed it, then shut down/booted with it replaced. The same screen resulted. There was no way to save the log as ubuntu would not boot so I copied a few lines down that may be useful below. If you need more information I can run it again and take a picture if needed.



```
[     5.427977] [dtm] Initialized radeon 2.12.0 20080528 for 0000:01:05.0 on minor 0
```


```
[     5.534483] sd 4:0:0:0: [sdb] 15771720 512-byte logical blocks: (8.07 GB/7.52 GiB)
```


```
sh: 1: cannot create /var/run/motd.new: Input/output error
[     70.624794] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 589252
[     70.625036] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 589252
[     70.625754] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 589252
[     70.627364] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 589252
[     70.627489] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 589252
[     70.627607] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 589252
[     70.627725] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 589252
```
This might have something to do with the fact I had a second ubuntu installation on my computer initially, but even after I uninstalled it, there were no problems immediately after.


----------



## hal8000 (Dec 23, 2006)

That a corrupted file alright, once you have deleted inodes there is no way to repair it except reload.
If you have a CD drive and some hard drive space, I would install Ubuntu on dedicated partitions, you would have to delete swap on sda4 make it an extended partition then create logical drives for /, /home and /swap.


----------



## Sapphire Dragon (Nov 2, 2012)

Alright then, I understand. My main use of ubuntu is to provide a safe OS across multiple computers, so I would need it to be in a LiveUSB format (unless you can install to a USB with all the same features, but I heard LiveUSB is more compatible). Is there any way I can use ubuntu this way, without the persistence file corrupting? I'm thinking I either tried to install more data than the file could hold or something weird happened between the 2 ubuntu OSes interacting with drives (definitely not doing that again). If there was some kind of reference deleted, my best guess is that it was from me uninstalling my computer's ubuntu so the LiveUSB could have access to my drives.


----------



## hal8000 (Dec 23, 2006)

The problem with a Live USB image is they need a FAT32 filesystem so that the BIOS can read the filesytem. The corruption may have come about if you have windows on your system which may have corrupted the fat32 file system or perhaps the drive was not cleanly unmounted before unplugging.

If you have a CD/DVD I would install Ubuntu on permanent partitions with native linux file systems. It has the advantage that windows cant read linux file systems, and the second advantage that all linux filesystems are journalled and there is no fragmentation, (well
not quite true after 6 years of daily use one of my ext3 partitions had a mere 1.6% fragmentation).

If you have multiple computers then you can install Ubuntu on each, one way to share dat is to create a free dropbox account or free Ubuntu One account that will give you cloud storage.


----------

