I'm working on a bash class project which needs me to create 2 partitions in Ubuntu and make them be automatically mounted each time the systems boots with fstab.

I got the following file which creates (I think correctly) the 2 partitions needed and adds them to the fstab file.

#!/bin/bash

#SVN Partition
(echo n; echo p; echo ; echo ; echo +20G; echo w;) | sudo fdisk /dev/sdb

#WEB Partition
(echo n; echo p; echo ; echo ; echo +5G; echo w;) | sudo fdisk /dev/sdb

sudo su -c "echo '/dev/sdb1        /svn  ext4    rw,user,auto,utf8      0       0' >> /etc/fstab"
sudo su -c "echo '/dev/sdb2        /web  ext4    rw,user,auto,exec,utf8 0       0' >> /etc/fstab"

When I reboot the system an error appears telling me the automatic mounting for /web and /svn failed.

Does anyone have a clue on what is happening? Thanks in advance.

有帮助吗?

解决方案

You haven't formatted the filesystems...

Execute these before reboot.

sudo mkfs.ext4 /dev/sdb1
sudo mkfs.ext4 /dev/sdb2
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top