jkreski
Posts: 9
Joined: Wed Jul 26, 2017 12:35 pm
Location: Beulah, MI USA
Contact: Website Facebook Twitter YouTube

mount: /dev/sda is already mounted or /mnt/usbdrive busy

Tue Jan 02, 2018 10:59 pm

I am trying to work with the space on a MyPassport USB drive. When I run lsblk I see that my RSP3b sees the drive and sees the space available. When I go to /media/pi/root I can see the administrative / system files. My /etc/fstab file contents are shown below as well. Here's the rub. When I start File Manager it only shows the space available on the SD card - and none of the space available on the USB Mass Storage device - i.e. - MyPassport. Also listed below is a system listing that speaks to the file types involved.

I have the bootcode.bin file on my card. I set the bit to recognise the USB device. I have installed the nts-3g files for NTSF formats.

What am I missing?

lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.7G 0 disk
├─sda1 8:1 0 63M 0 part
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 32M 0 part /media/pi/SETTINGS
└─sda6 8:6 0 465.6G 0 part /media/pi/root
mmcblk0 179:0 0 29.7G 0 disk
├─mmcblk0p1 179:1 0 1.2G 0 part
├─mmcblk0p2 179:2 0 1K 0 part
├─mmcblk0p5 179:5 0 32M 0 part /media/pi/SETTINGS1
├─mmcblk0p6 179:6 0 66M 0 part /boot
└─mmcblk0p7 179:7 0 28.4G 0 part /

FSTAB:
proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
#/dev/sda1 /dev ntfs-3g auto,nofail,rw,default 0 0
/dev/sda /mnt/usbdrive auto nofail,uid=1000,gid=1000,x-systemd.automount 0 0

/dev/mmcblk0p1: LABEL="RECOVERY" UUID="3461-3439" TYPE="vfat" PARTUUID="ae420040-01"
/dev/mmcblk0p5: LABEL="SETTINGS" UUID="c7bb72e1-f7e6-4f52-b1a0-d6d372328884" TYPE="ext4" PARTUUID="ae420040-05"
/dev/mmcblk0p6: LABEL="boot" UUID="1B06-75B9" TYPE="vfat" PARTUUID="ae420040-06"
/dev/mmcblk0p7: LABEL="root" UUID="f496dedb-e554-4565-a770-290ced3211ad" TYPE="ext4" PARTUUID="ae420040-07"
/dev/sda1: SEC_TYPE="msdos" LABEL="RECOVERY" UUID="ADE0-00D5" TYPE="vfat" PARTUUID="755cc958-01"
/dev/sda5: LABEL="SETTINGS" UUID="ba44816f-aba8-48b9-8aaf-53ff42c58df5" TYPE="ext4" PARTUUID="755cc958-05"
/dev/sda6: LABEL="root" UUID="888db461-ba0c-4d5a-8326-8147406a8f06" TYPE="ext4" PARTUUID="755cc958-06"
/dev/mmcblk0: PTUUID="ae420040" PTTYPE="dos"

beta-tester
Posts: 1202
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: mount: /dev/sda is already mounted or /mnt/usbdrive busy

Wed Jan 03, 2018 1:30 pm

jkreski wrote:
Tue Jan 02, 2018 10:59 pm
What am I missing?
FSTAB:
proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
#/dev/sda1 /dev ntfs-3g auto,nofail,rw,default 0 0
/dev/sda /mnt/usbdrive auto nofail,uid=1000,gid=1000,x-systemd.automount 0 0

/dev/mmcblk0p1: LABEL="RECOVERY" UUID="3461-3439" TYPE="vfat" PARTUUID="ae420040-01"
/dev/mmcblk0p5: LABEL="SETTINGS" UUID="c7bb72e1-f7e6-4f52-b1a0-d6d372328884" TYPE="ext4" PARTUUID="ae420040-05"
/dev/mmcblk0p6: LABEL="boot" UUID="1B06-75B9" TYPE="vfat" PARTUUID="ae420040-06"
/dev/mmcblk0p7: LABEL="root" UUID="f496dedb-e554-4565-a770-290ced3211ad" TYPE="ext4" PARTUUID="ae420040-07"
/dev/sda1: SEC_TYPE="msdos" LABEL="RECOVERY" UUID="ADE0-00D5" TYPE="vfat" PARTUUID="755cc958-01"
/dev/sda5: LABEL="SETTINGS" UUID="ba44816f-aba8-48b9-8aaf-53ff42c58df5" TYPE="ext4" PARTUUID="755cc958-05"
/dev/sda6: LABEL="root" UUID="888db461-ba0c-4d5a-8326-8147406a8f06" TYPE="ext4" PARTUUID="755cc958-06"
/dev/mmcblk0: PTUUID="ae420040" PTTYPE="dos"
at line 7 you try to mount the whole /dev/sda - with option nofail. it maybe reserves a file handle for that mount point - even /dev/sda does not has a file system, that can be mounted as is.
but that means, that you can not mount partitions /dev/sda[1-6] any more, because /dev/sda is already in use - even it is not actively used.

try to comment out line 7 and mount its partitions (/dev/sda1 ... /dev/sda6) instead - like done in line 6 but with proper mount point.
e.g.
/dev/sda6 /mnt/usbdrive auto nofail,auto,x-systemd.automount 0 0
{ I only give negative feedback }
RPi Model B (rev1, 256MB) & B (rev2, 512MB) & B+, RPi2B (1GB), 64GB microSDXC1 class 10, HDMI 1920x1080, keyboard-mouse-combo (wireless), PiCamera, ethernet-cable, 5V/1.2A power supply, Wifi dongle (rt5370)

User avatar
thagrol
Posts: 572
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: mount: /dev/sda is already mounted or /mnt/usbdrive busy

Wed Jan 03, 2018 2:10 pm

To add to that, in general you don't mount an entire block device (/dev/sda), you mount the partitions on that device (/dev/sda1 etc).

You need to create mount points and fstab entries for each partition. It's also generally better to mount by UUID or label rather than device node as, especially with USB devices, device node can change across reboot.
Note to self: don't feed the trolls

jkreski
Posts: 9
Joined: Wed Jul 26, 2017 12:35 pm
Location: Beulah, MI USA
Contact: Website Facebook Twitter YouTube

Re: mount: /dev/sda is already mounted or /mnt/usbdrive busy

Thu Jan 04, 2018 1:39 pm

I read last night about a disk utility - gnome-disk-utility in Synaptic Manager - on unix.stackexchange.com. I installed both. This utility, while maybe it is out of date - not sure - does allow me to see the drive, it's mount points and status in a nice graphical user interface.
I found /dev/sda6 had the linux space I wanted. I found where it was mounted. I unmounted it, specified a new mount location and rebooted. The utility remounted it
here:

/media/pi/root1

The /etc/fstab file that that was created after it was mounted on reboot was:

proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
#/dev/sda6 /dev ntfs-3g auto,nofail,rw,default 0 0

Aparently I could not see the space, I think anyway, because it was not mounted high enough and I did not know it was mounted or where it was mounted. Once I clicked on only the folder specified the 500 or so gig was available. That raises several questions:

1) Is that normal? My guess is yes.
2) How do I ensure, once it is mounted where it should be, that when I install software, etc. that my files are installed there and that the system can use that space for system files, softwares, data files, etc. automatically? There must be some variant of a Windows PATH command?

User avatar
thagrol
Posts: 572
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: mount: /dev/sda is already mounted or /mnt/usbdrive busy

Thu Jan 04, 2018 2:39 pm

jkreski wrote:
Thu Jan 04, 2018 1:39 pm

The /etc/fstab file that that was created after it was mounted on reboot was:

proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
#/dev/sda6 /dev ntfs-3g auto,nofail,rw,default 0 0
That's the same fstab as you posted above. That disk utility doesn't do anything to fstab, it uses it's own config data, it's an auto mount tool for the desktop.

Incidentally, the commented out line you have for /dev/sda6 is bad, really bad. You've specified the mount point as /dev It would probably fail, but if it didn't expect all sorts of weird and interesting stuff to happen as all the device nodes become invisible.
There must be some variant of a Windows PATH command?
Yes, but PATH doesn't do what you seem to think it does. PATH (the PATH env variable on linux) tells the shell where to look for programs not where to install them.

Looking back, if I interpret your first post correctly, what you want is to booth the PI from the USB drive not to boot from SD card and use a mounted USB HDD?

If so, you're probably going about things the wrong way. I've not used USB boot so hopefully someone who has will correct any mistakes.

As I understand it, once you've set the USB boot flag you take out the SD card, attach the USB device and boot. The PI expects the USB drive to be partition and formatted in the same manner as the SD card would be: first partition is fat32 and the boot partition, second etx4 and has the system. Other partitions may exist beyond that but will be ignored until you configure the system to do something with them.

For your desired use case, you need to either install raspbian to the USB drive as you would to an SD card (which will destroy any data already on that drive) or copy the existing system to the linux partition on that drive and (re)configure an SD card so while the PI boots from that, it uses the USB device in place of the normal system partition.

See here for the USB boot option: https://www.raspberrypi.org/documentati ... des/msd.md

This looks like a good bet for the second option: viewtopic.php?t=44177

Disclaimer: I've not used either of these methods and make sure you know what you are doing and have backed up your data before you start making changes to partitions on your USB drive.
Note to self: don't feed the trolls

Return to “General discussion”

Who is online

Users browsing this forum: HawaiianPi, Heater, major96835, MaxK1, sakaki and 47 guests