3

I'm trying to mount my two harddrives (sdb and sdc) on Ubuntu 18.04

 $ sudo fdisk -l Disk /dev/sda: 111.8 GiB, 120040980480 bytes, 234455040 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 843403B2-BF09-43A4-8B53-A44D8FAEF693 Device Start End Sectors Size Type /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 234452991 233402368 111.3G Linux filesystem Disk /dev/sdb: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 9924BB77-E1D6-4E03-852F-454F360F6F41 Device Start End Sectors Size Type /dev/sdb1 2048 5860532223 5860530176 2.7T Linux filesystem Disk /dev/sdc: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 16696FCE-133A-47CC-8CDB-BD59002A6A24 $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 111.8G 0 disk ├─sda1 8:1 0 512M 0 part /boot/efi └─sda2 8:2 0 111.3G 0 part / sdb 8:16 0 2.7T 0 disk └─sdb1 8:17 0 2.7T 0 part sdc 8:32 0 2.7T 0 disk 

'sudo mount /dev/sdb1 /media' doesn't seem to work and gives me the error '/dev/sdb1 is not a block device.'. How do I mount it?

3
  • You could start by creating a partition and putting a filesystem on them. What do you think you'd be able to do with the disks unless there's a filesystem on them? Commented May 24, 2019 at 2:43
  • ok I partitioned it (put it all on 1 partition, sdb1). When trying to mount I get '/dev/sdb1 is not a block device.' Ideas? Commented May 24, 2019 at 2:55
  • I just updated my question Commented May 24, 2019 at 3:01

1 Answer 1

3

Welcome to the StackExchange!

First of all, you would need to format or add at least one partition to the newly added hard drives.

This can be accomplished by either using the terminal with fdisk type this to select the first hard drive you mentioned:

$ fdisk /dev/sdb

Type ‘n’ to create a new partition.

Specify where you would like the partition to end and start. You can set the number of MB of the partition instead of the end cylinder. For example: +1000M

Type ‘p’ to view the partition, and type ‘w’ to save the partition.

Run the command:

$ partprobe

This will allow your OS to detect the new partition table. If it still does not detect the partition table, you might need a reboot.

Then format the newly created partition with mke2fs this is used to create an ext2, ext3, or ext4 filesystem, usually in a disk partition. See the mke2fs(8) manual page for more details.

# mkfs.ext4 -L myHDD /dev/sdb1

Then create a directory to mount the partition to:

# mkdir -p /mnt/media

then mount(8) the newly created partition to the newly created directory:

# mount /dev/sdb1 /mnt/media

then run the command lsblk(8):

$ lsblk -f

NAME FSTYPE LABEL UUID MOUNTPOINT sda └─sdb1 ext4 myHDD 56adc99b-a61e-46af-aab7-a6d07e504652 /mnt/media

In order to make the partition automatically mount every time you boot your system you would need to add the newly created partition to your fstab(5) file.

/etc/fstab

 device dir type options dump fsck /dev/sdb1 / ext4 noatime 0 1 /dev/sdb2 none swap defaults 0 0 /dev/sdb3 /home ext4 noatime 0 2 

or you could use a GUI like gparted which basically does all of the above with a couple of mouse clicks if you're not comfortable using the terminal.

3
  • 1
    "sudo mount /dev/sdb1 /media doesn't seem to work and gives me the error '/dev/sdb1 is not a block device.'. How do I mount it?" You need to add a space after the mount command and another space after your sdb1 Commented May 24, 2019 at 3:56
  • Does this look like a good fstab entry: UUID=c7676348-115f-4200-98a0-eceb9918352c /media/hdd1 ext4 auto,user,rw 0 1 Commented May 24, 2019 at 4:00
  • 1
    @Hackerman Yes your fstab entry looks fine and you shouldn't have any problems with it. Commented May 24, 2019 at 4:06

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.