PDA

View Full Version : Unable to mount USB partition on custom Ubuntu LIVE system



goldstein2
February 15th, 2016, 12:34 AM
Hello,


I'm having a trouble to mount partition(s) on my custom made Ubuntu Live system. The following image has been generated by xorriso command and its
-append_partition command option:




Disk /dev/sdb: 14.9 GiB, 16008609792 bytes, 31266816 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: 0x5fabc9af


Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 0 3002879 3002880 1.4G 0 Empty
/dev/sdb2 9492 14035 4544 2.2M ef EFI (FAT-12/16/32)
/dev/sdb3 3002880 3102879 100000 48.8M b W95 FAT32



When using dd command to transfer this image to USB drive I have no trouble to access/mount, read and write to third partition on the USB stick using a separate
Linux system. USB also boots perfectly into the custom Ubuntu system. However, my only problem is the I cannot access /dev/sdb3 within the custom
Ubuntu Live system. Every attempt to mount this partition results in:



mount /dev/sdb3 /mnt/
mount: /dev/sdb3 is already mounted or /mnt busy


Here are all partitions as seen by the live system where the sda is my local disk and sdb is the actual USB stick with custom ubuntu image on it used to boot
the system:

## blkid -o list
device fs_type label mount point UUID
-------------------------------------------------------------------------------
/dev/loop0 squashfs /rofs
/dev/sda1 xfs (not mounted) e29ab5aa-f4ed-4b26-8e1a-f85eec483874
/dev/sda2 crypto_LUKS (not mounted) 7d2cf5fb-d75b-4e82-af88-2bfd642a3875
/dev/sda3 crypto_LUKS (not mounted) a03eb795-16bd-4f6b-8ed3-54540d9df3a5
/dev/sdb1 iso9660 ISOIMAGE (in use) 2016-02-15-02-09-35-00
/dev/sdb2 vfat (in use) 95A5-9B60
/dev/sdb3 vfat (in use) EBBE-A10B



The system output clearly states that /dev/sdbX is in use. Looking further I found that the entire block device /dev/sdb is mounted under /cdrom as iso9660
filesystem:



# findmnt
TARGET SOURCE FSTYPE OPTIONS
/ /cow overlay rw,relatime,lowerdir=//filesystem.squashfs,upperdir=/cow/upper,workdir=/cow/work
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup tmpfs tmpfs rw,mode=755
│ │ ├─/sys/fs/cgroup/systemd cgroup cgroup
rw,nosuid,nodev,noexec,relatime,xattr,release_agen t=/lib/systemd/systemd-cgroups-agent,name=systemd
│ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
│ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset,clone_child ren
│ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
│ │ ├─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
│ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
│ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
│ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup
rw,nosuid,nodev,noexec,relatime,hugetlb,release_ag ent=/run/cgmanager/agents/cgm-release-agent.hugetlb
│ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup
rw,nosuid,nodev,noexec,relatime,perf_event,release _agent=/run/cgmanager/agents/cgm-release-agent.perf_event
│ │ └─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids,release_agent =/run/cgmanager/agents/cgm-release-agent.pids
│ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
│ ├─/sys/firmware/efi/efivars efivarfs efivarfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/fuse/connections fusectl fusectl rw,relatime
│ └─/sys/kernel/debug debugfs debugfs rw,relatime
│ └─/sys/kernel/debug/tracing tracefs tracefs rw,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=33,pgrp=1,timeout=0,minproto=5,maxp roto=5,direct
├─/dev udev devtmpfs rw,nosuid,relatime,size=4013296k,nr_inodes=1003324 ,mode=755
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode= 000
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/mqueue mqueue mqueue rw,relatime
│ └─/dev/hugepages hugetlbfs hugetlbfs rw,relatime
├─/run tmpfs tmpfs rw,nosuid,noexec,relatime,size=805532k,mode=755
│ ├─/run/lock tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k
│ ├─/run/cgmanager/fs cgmfs tmpfs rw,relatime,size=100k,mode=755
│ └─/run/user/999 tmpfs tmpfs rw,nosuid,nodev,relatime,size=805532k,mode=700,uid =999,gid=999
│ └─/run/user/999/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=999,group_id=999
├─/cdrom /dev/sdb iso9660 ro,noatime
├─/rofs /dev/loop0 squashfs ro,noatime
└─/tmp tmpfs tmpfs rw,nosuid,nodev,relatime



The reason I have created additional partitions is to have a persistent disk space on my USB Ubuntu live system.


Any help or suggestions on how to access /dev/sdb3within a live system would be appreciated. Eventually, I would like the /dev/sdb3 partition to be mounted
automatically during the system boot.


thank you

sudodus
February 15th, 2016, 07:28 AM
Welcome to the Ubuntu Forums :-)


/cdrom /dev/sdb iso9660 ro,noatime

It can be a problem to make partitions work properly on a drive that starts with an iso9660 file system at the device level. This system is read only (originally made for CD/DVD disks).

I suggest that you create a persistent live drive with mkusb. Then you will have a partition for persistence, so you can use the whole drive. You can also use part of the drive for persistence and part of it for communication with Windows.

- Persistence: a 'casper-rw' label on an ext4 partition

- Windows: a 'usbdata' label on an NTFS partition

See these links

mkusb (https://help.ubuntu.com/community/mkusb)

mkusb/persistent (https://help.ubuntu.com/community/mkusb/persistent)

There is also the alternative to install Ubuntu into the USB pendrive (install like it would be installed into an internal drive),

Try Ubuntu (Kubuntu, Lubuntu, Xubuntu, ...) before installing it (http://ubuntuforums.org/showthread.php?t=2230389)

scdbackup
February 15th, 2016, 08:01 AM
If the error message is because /dev/sdb is already mounted, mount option
-o loop might do the trick.

scdbackup
February 15th, 2016, 01:24 PM
Hi,

i made experiments on my Debian 8 meanwhile with a
debian-8.2.0-amd64-netinst.iso on USB stick. It has an EFI System Partition
as /dev/sdc2 and also /dev/sdc1 which starts at LBA 0 (same as /dev/sdc).
As superuser (or by sudo):


$ mount /dev/sdc /mnt/iso
mount: /dev/sdc is write-protected, mounting read-only
$ mount /dev/sdc2 /mnt/fat
mount: /dev/sdc2 is already mounted or /mnt/fat busy
$ mount -o loop /dev/sdc2 /mnt/fat
$ ls /mnt/fat
efi
$
$ umount /mnt/iso /mnt/fat
$
$ mount /dev/sdc1 /mnt/iso
mount: /dev/sdc1 is write-protected, mounting read-only
$ mount /dev/sdc2 /mnt/fat
$ ls /mnt/fat
efi

So i can reproduce the described problem on ye olde Linux 3.16.
-o loop does help, but possibly is more a bug than a feature.
umounting /dev/sdb and taking advantage of mountable /dev/sdb1
would be the neatest solution.
One needs a mountable /dev/sdb1 which you obviously created
by xorriso options or by program isohybrid.

Thank you for flying xorriso.

Have a nice day :)

Thomas

goldstein2
February 16th, 2016, 10:27 PM
Hi Guys,


-o loop worked perfectly.

Having:

/cdrom /dev/sdb1 iso9660 ro,noatime
would possibly be a more elegant solution but -o loop will suffice.

Another question (http://ubuntuforums.org/showthread.php?t=2313885&p=13441091#post13441091) is whether xorriso or above mentioned mkusb can be used to reorder all partitions while adding yet another partition to the beginning to the partition table?

thank you for your help, it's much appreciated...

sudodus
February 17th, 2016, 07:20 AM
I don't know about xorriso, but I'm reading about this method to loop mount and make things work. Thanks scdbackup :-)


mkusb can be used to create a fresh partition table and a fresh persistent live system, but it cannot reorder partition that already exist in a drive.

Please describe in detail what you have and what you want!

scdbackup
February 17th, 2016, 08:46 AM
Hi, glad that i could be of help. I will reply to the new question in its own thread. (Not that i could propose an immediate solution.) Have a nice day :) Thomas

goldstein2
February 17th, 2016, 09:47 PM
I don't know about xorriso, but I'm reading about this method to loop mount and make things work. Thanks scdbackup :-)


mkusb can be used to create a fresh partition table and a fresh persistent live system, but it cannot reorder partition that already exist in a drive.

Please describe in detail what you have and what you want!

Hi,

I need to add/prefix a new partition to the beginning of the filesystem. If it takes re-creating all partition without limiting the system's ability to boot it definitely can also be considered as a solution. The new question is posted here (http://ubuntuforums.org/showthread.php?t=2313885&p=13441091#post13441091).

thank you

sudodus
February 17th, 2016, 10:00 PM
I thought you had solved the problem. Try again with mkusb and create a persistent live system. When asked for a percentage for persistence, share the remaining space between persistence and communication with Windows (select for example 30%, 50% or 70% for persistence).