| Author |
Message |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Mon 30 Apr 2012, 15:24 Post subject:
command line mount not working |
|
I need to mount a USB drive via command. The icon shows up when plugged in, but "mount /dev/sdc1 /mnt/sdc1" gets an error about not finding it in fstab.
|
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 1718 Location: Burghaslach, Germany
|
Posted: Mon 30 Apr 2012, 15:36 Post subject:
command line mount |
|
Looks like type is needed
| mount --help wrote: | Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount . |
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Mon 30 Apr 2012, 16:54 Post subject:
|
|
already tried that; no cigar. Anyone know what the mount command is for a usb drive in puppy?
|
|
Back to top
|
|
 |
Semme
Joined: 07 Aug 2011 Posts: 2051 Location: World_Hub
|
Posted: Mon 30 Apr 2012, 17:55 Post subject:
|
|
Perhaps like this: mount -o loop /dev/usb-from-fdisk /mnt/home/directory-of-choice
Still no good- replug it. What's on it.. you didn't mention the fs. Formatted by a Win utility?
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Mon 30 Apr 2012, 18:48 Post subject:
|
|
what worked:
mount -t vfat -o rw,users /dev/sdb1 /mnt/sdb1
edit: well...now anything works...
Still doesn't mount unless I mount/unmount it first from the gui....
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Mon 30 Apr 2012, 19:25 Post subject:
|
|
Seems to need first creating a loop and then mounting in a separate step. Strange...
mount -o loop /dev/sdb1 /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
Thanks guys!
|
|
Back to top
|
|
 |
Geoffrey

Joined: 30 May 2010 Posts: 919 Location: Queensland Australia ɹǝpu∩uʍop
|
Posted: Mon 30 Apr 2012, 21:32 Post subject:
|
|
| jpeps wrote: | Seems to need first creating a loop and then mounting in a separate step. Strange...
mount -o loop /dev/sdb1 /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
Thanks guys! |
I found that I need to make a directory first, call it what ever you like
mkdir /mnt/flash-drive;mount /dev/sdc1 /mnt/flash-drive
umount /dev/sdc1;rm -r /mnt/flash-drive
|
|
Back to top
|
|
 |
Semme
Joined: 07 Aug 2011 Posts: 2051 Location: World_Hub
|
Posted: Mon 30 Apr 2012, 21:40 Post subject:
|
|
umount, as far as my tests go needs only the mounted directory spec'd: umount /mnt/flash-drive
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Mon 30 Apr 2012, 22:36 Post subject:
|
|
| Geoffrey wrote: | | jpeps wrote: | Seems to need first creating a loop and then mounting in a separate step. Strange...
mount -o loop /dev/sdb1 /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
Thanks guys! |
I found that I need to make a directory first, call it what ever you like
mkdir /mnt/flash-drive;mount /dev/sdc1 /mnt/flash-drive
umount /dev/sdc1;rm -r /mnt/flash-drive |
If you use a loop, it functions just like an SFS. The second mount command is actually unnecessary, although it makes the icon on the desktop appear mounted. Files are available either way. To umount: "umount /mnt/sdb1" (terminates the loop)
| Description |
|
| Filesize |
8.47 KB |
| Viewed |
333 Time(s) |

|
|
|
Back to top
|
|
 |
nooby
Joined: 29 Jun 2008 Posts: 9389 Location: SwedenEurope
|
Posted: Tue 01 May 2012, 05:41 Post subject:
|
|
| Geoffrey wrote: | | jpeps wrote: | Seems to need first creating a loop and then mounting in a separate step. Strange...
mount -o loop /dev/sdb1 /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
Thanks guys! |
I found that I need to make a directory first, call it what ever you like
mkdir /mnt/flash-drive;mount /dev/sdc1 /mnt/flash-drive
umount /dev/sdc1;rm -r /mnt/flash-drive |
Pardon me for jumping into something I know nothing about.
I made a search to see if the subject has been up before
and it had and few knew the solution. Maybe my search
where too hasty. But this seems to be something that maybe
need a sticky or something so many can find it later if your guys
are not there to retell how one do it.
And I get curious. This means puppy is not only different
but very different from other Linux. What made it this difficult
to mount an USB? This solution has to be shared does it not?
_________________
I'm a noob so I use Google Search of Puppy Forum
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2678 Location: Kiel,Germany
|
Posted: Tue 01 May 2012, 14:00 Post subject:
|
|
have you heard about the losetup command ?
losetup /dev/loop# /path/to/filename
mkdir /mnt/mountpoint
mount -o loop /dev/loop# /mnt/mountpoint
Normally mount tries to autodetect the filesystemtype ..
Another thing : AppRun aka /usr/local/bin/drives_all creates the mountpoint directory and after unmounting, it does not delete /mnt/mountpoint .
Thats why mount /dev/sdb1 may have succeeded .
I have altered /bin/mount script to create /mnt/mountpoint directory automatically :
| Code: | j=0
for i in `seq 1 $#` ; do
j=$((j+1))
PARAM=`echo "$*" | cut -f $i -d ' '`
echo '$'$j' ='"$PARAM"
if [ -n "`echo $PARAM | grep '/' | grep -v /dev/`" ] ; then
[ -e $PARAM ] || { echo 'Folder '"$PARAM"' does not exists. Creating now ...';mkdir -p $PARAM; }
fi
done |
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Tue 01 May 2012, 15:49 Post subject:
|
|
| Karl Godt wrote: | have you heard about the losetup command ?
|
Yes..I'm using it for sfscheck. You can get the printout posted above (without the number of loops) with "losetup"
It seems simple to just use "mount -o loop /dev/... /mnt/... ", which creates a mountpoint & mounts the device in a loop without having to create/delete a directory and allows a simple dismount "umount /mnt/..."
|
|
Back to top
|
|
 |
|