how to auto-mount a second ext4 HD

Asked by Massimiliano Maniscalco on 2012-09-23

I have an SSD with the system and a second HD with data in my PC. I would like the HD to be mounted when I boot the PC.
Both of them have ext4 filesystem, it's a ubuntu only PC.
This is the result of sudo fdisk -l
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 testine, 63 settori/tracce, 243201 cilindri, totale 3907029168 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x00028ad9

Dispositivo Boot Start End Blocks Id System
/dev/sda1 2048 3907028991 1953513472 83 Linux

Disk /dev/sdb: 128.0 GB, 128035676160 bytes
255 testine, 63 settori/tracce, 15566 cilindri, totale 250069680 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x00003ec2

Dispositivo Boot Start End Blocks Id System
/dev/sdb1 * 2048 217145343 108571648 83 Linux
/dev/sdb2 217147390 250068991 16460801 5 Esteso
/dev/sdb5 217147392 250068991 16460800 82 Linux swap / Solaris

Disk /dev/sdc: 320.1 GB, 320072931840 bytes
255 testine, 63 settori/tracce, 38913 cilindri, totale 625142445 settori
Unità = settori di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x000d526b

Dispositivo Boot Start End Blocks Id System
/dev/sdc1 2048 625141759 312569856 83 Linux

I tried to add this line to my /etc/fstab

/dev/sda /media/MyData ext4 defaults 0 0

I tried to reboot but an error message say can't mout /media/MyData press S to skip or M to manual setup... can't understand how to do.
It seems everyone ask how to mount a second HD with ntfs, but how to do if it's a ext4?
Thank you for your help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
2012-09-23
Last query:
2012-09-23
Last reply:
2012-09-23

You use sda1, that is the first filesystem. /dev/sda is the actual drive itself which you cannot mount, you can mount /dev/sda1

Thanks actionparsnip, that solved my question.

You can't mount drives, no matter what your dumb Windows OS says. It is a partition. If you have a drive and make 2 partitions you will be shown a 'C drive' and a 'D drive', which is wrong. There is only one drive, just with 2 partitions. It confuses users when they come to an OS which names things correctly.

Yes, I know I can't mout drives, I just got confused with names. You're right about other OS which show partitions like drives. In the real I don't come from Windows, but I was a Mac user from about 10 years. Now I use only Ubuntu. Thanks again!