mount point /dev/sdb1/mnt is not a directory - linux

I'm partway through an installation of Arch Linux and, following the online instructions, I'm mounting /dev/sdb1/mnt.
When I input
mount /dev/sdb1/mnt
it returns
mount: you must specify the filesystem type
Using both auto and ext4 (my filesystem type, I'm fairly certain)
mount auto /dev/sdb1/mnt
I get
mount: mount point /dev/sdb1/mnt is not a directory
What is going on here?

You are missing a space:
# right here---v
mount /dev/sdb1 /mnt
The mount command wants a device and a directory. /dev/sdb1 is the device, and /mnt is the directory.

Related

Programmatically obtaining USB file system format

I need to mount a USB drive to an embedded system, running Linux. The USB could be in FAT, NTFS or ExFAT format.
How can i handle this in code so that I pass proper type in mount command such as
mount -t vfat /dev/sda1 /mnt
So I have tried mount with:
mount -t vfat,ntfs /dev/sda1 /mnt
This command gives invalid argument, but it successfully mounts the USB if USB is in NTFS or VFAT format. However if i try to give
mount -t vfat,ntfs,exfat /dev/sda1 /mnt
The command fails.
Any pointers will be really helpful.
From the mount manual page:
If no -t option is given, or if the auto type is specified,
mount will try to guess the desired type. Mount uses the blkid
library for guessing the filesystem type...
Is libblkid available for your embedded system?
Try:
mount -t auto /dev/sda1 /mnt
or
mount /dev/sda1 /mnt
And as mentioned in the comments, make sure the kernel on your embedded system supports exfat.

how to check if a location is on NFS or RAM

I know if I put file on /dev/shm, then it is put on RAM of the server.
And if I put in my home directory, it is put on NFS.
And i know there is a command to tell if a given location on NFS or maybe RAM, what's that command?
Ex, how can I be sure my home directory is on NFS? I remember by using that command, some prints "NFS" can be seen
You can use the df command to show you the directory's mount point:
[mrsam#octopus ~]$ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/md0 178G 32G 137G 19% /home
So, my current directory is on a filesystem that's mounted on /dev/md0.
Based on the device that the filesystem is mounted on, you can then figure out if it's a local filesystem, an NFS mount, or something else.

UBIFS mount in busybox via fstab does not recognize relatime option

I am getting this error when I try to mount my UBIFS filesytem:
mount -o remount,rw /config
UBIFS error (pid 1265): ubifs_parse_options: unrecognized mount option "relatime" or
missing value
The content of my fstab is :
root#drgos:~# cat /etc/fstab
# WARNING: this is an auto generated file, please use uci to set static filesystems
/dev/ubi0_0 /config ubifs ro 0 0
And when I type mount the result is :
root#drgos:~# mount
rootfs on / type rootfs (rw)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
none on /dev/pts type devpts (rw,relatime,mode=600)
/dev/ubi0_0 on /config type ubifs (ro,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
I do not understand why I have the option relatime since that one is not present in my fstab!
I am using BusyBox v1.11.2 (2014-01-13 09:35:41 CET) multi-call binary.
These options are dependent on the Linux kernel version. relatime is a general mount options. relatime is the default for newer Linux kernels. Other filesystems may quietly ignore unknown options, whereas ubifs is failing. You can try mount -o remount,rw,noatime,norelatime /config. Your mount command shows the /config directory is mounted with relatime; this is information that busybox mount applet collected.
This information is collected with the getmntent_r() function. If busybox is dynamically linked, then the 'C' library may be giving this information as part of the *mnt_opts* string.
The idea with mount -o remount,rw,noatime,norelatime /config is to try and over-ride this information so that UbiFs will be happy with its mount options. The other way is to simply umount and then mount again manually.
umount /config
mount -t ubifs /dev/ubi0_0 /config
This way previous mount information will not be retrieved.

How to determine the type of file system on an SD Card

How to determine the type of file system on an SD Card (this card is not yet mounted. I need to determine the file system type so that i can mount the SDCard through a program according to the file system type)
Or from the terminal. For example "mount -t ext3 /dev/sdc1 /mnt"
You might do a file -s /dev/sdc1 and it could recognize the filesystem data.
And you might do mount -t auto /dev/sdc1 /mnt to have mount recognize it.

Mounting block device driver module on linux stopped working

I make block device driver module and insert module on Ubuntu. And then I want to mount that module as file system using 'mkfs'command. But, mkfs command didn't work more with following message:
writing superblocks and filesystem accounting information
mkfs doesn't mount block devices. It creates filsystems on them. (I hope that there was nothing interesting on you device; mkfs has deleted the data on block device). To mount a block devices (or better to say to mount the filesystem that is on the blockdevice) you must use mount:
# mount /dev/sda1 /mnt
(presuming /dev/sda1 is the device you try to mount).
Don't forget to unmount the device when you need it no more:
# umount /mnt

Resources