I am trying to create an automated mount for an external hard drive, but it keeps failing. I am a little newbiew at linux.
I have googled and searched in StackExchange and I tried a lot of things, but I did not find a solution for my problem.
OS: Raspbian Stretch
Those are the steps I did:
sudo mkfs.ext4 /dev/sda1 -L hdd_moc
mke2fs 1.43.4 (31-Jan-2017)
/dev/sda1 contains a ext4 file system labelled 'hdd_owncloud'
last mounted on Mon Feb 12 09:34:38 2018
Proceed anyway? (y,N) y
Creating filesystem with 244181760 4k blocks and 61046784 inodes
Filesystem UUID: b9b47e44-db76-40de-a0ed-940c9699799a
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
sudo mkdir /mnt/hdd_moc
sudo groupadd www-data
sudo usermod -a -G www-data www-data
sudo chown -R www-data:www-data /mnt/hdd_moc
sudo chmod -R 775 /mnt/hdd_moc
ls -l /mnt
total 4
drwxrwxr-x 2 www-data www-data 4096 Feb 12 10:06 hdd_moc
id -g www-data
33
id -u www-data
33
ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 15 Feb 12 09:49 9a7608bd-5bff-4dfc-ac1d-63a956744162 -> ../../mmcblk0p2
lrwxrwxrwx 1 root root 15 Feb 12 09:49 B60A-B262 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 10 Feb 12 10:12 b9b47e44-db76-40de-a0ed-940c9699799a -> ../../sda1
sudo nano /etc/fstab
proc /proc proc defaults 0 0
PARTUUID=ed7ab5b3-01 /boot vfat defaults 0 2
PARTUUID=ed7ab5b3-02 / ext4 defaults,noatime 0 1
UUID=b9b47e44-db76-40de-a0ed-940c9699799a /mnt/hdd_moc auto nofail,uid=33,gid=33,umask=0027,dmask=0027,noatime 0 0
sudo mount -a
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
sudo mount /dev/sda1 /mnt/hdd_moc -> It works, I can do a "ls".
So I think my problem is in the 4th line of fstab. I readed fstab info but I can not understand what I should do. (https://wiki.debian.org/fstab)
Thank you :)
You're overcomplicating things. The fact that the command
sudo mount /dev/sda1 /mnt/hdd_moc
works correctly shows you that your system is able to mount a ext4 filesystem without specific options. In fact, ext4 is one of the most common fs for Linux (if not the most one).
The mount options you're trying to use don't exist for ext4 fs. All you need to do is to rewrite the relevant /etc/fstab
line as such:
UUID=b9b47e44-db76-40de-a0ed-940c9699799a /mnt/hdd_moc ext4 defaults,nofail,noatime 0 0
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments