Editing fstab to mount partitions on a second hard drive

Forum rules
Before you post please read this
Post Reply
terry_g
Level 1
Level 1
Posts: 16
Joined: Mon Aug 28, 2017 11:10 am

Editing fstab to mount partitions on a second hard drive

Post by terry_g » Thu Apr 19, 2018 10:02 pm

Can I edit my fstab file the same way I did with Fedora?
I installed a second hard drive and created 4 ext4 partitions using gparted.
I created mount points for them in /mnt they are /sdb2 /sdb3 and /sdb4.
Here is a copy of my fstab with the last 3 lines that I added commented out.

Thanks Terry

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/mint--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=f02d2789-9504-40b7-be9f-30f90cb02096 /boot ext2 defaults 0 2
/dev/mapper/mint--vg-swap_1 none swap sw 0 0

#UUID=d5df10d6-3b2e-4dad-a044-9baddfb8c5b8 /mnt/sdb2 ext4 0 0

#UUID=fea67933-4d12-4d49-a503-12ac79809242 /mnt/sdb3 ext4 0 0

#UUID=53cb29a4-f21e-4687-96e6-cb8debe65c00 /mnt/sdb4 ext4 0 0

terry_g
Level 1
Level 1
Posts: 16
Joined: Mon Aug 28, 2017 11:10 am

Re: Editing fstab to mount partitions on a second hard drive

Post by terry_g » Thu Apr 19, 2018 10:30 pm

I see my first mistake i did not include "defaults" in each added line.
I know if I mess it up I can end with a non booting computer.
Terry


# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/mint--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=f02d2789-9504-40b7-be9f-30f90cb02096 /boot ext2 defaults 0 2
/dev/mapper/mint--vg-swap_1 none swap sw 0 0

#UUID=d5df10d6-3b2e-4dad-a044-9baddfb8c5b8 /mnt/sdb2 ext4 defaults 0 0

#UUID=fea67933-4d12-4d49-a503-12ac79809242 /mnt/sdb3 ext4 defaults 0 0

#UUID=53cb29a4-f21e-4687-96e6-cb8debe65c00 /mnt/sdb4 ext4 defaults 0 0

User avatar
WharfRat
Level 20
Level 20
Posts: 11574
Joined: Thu Apr 07, 2011 8:15 pm

Re: Editing fstab to mount partitions on a second hard drive

Post by WharfRat » Thu Apr 19, 2018 11:12 pm

They look good - I would just suggest adding errors=remount-ro after defaults so it looks like

UUID=d5df10d6-3b2e-4dad-a044-9baddfb8c5b8 /mnt/sdb2 ext4 defaults,errors=remount-ro 0 0
ImageImage

terry_g
Level 1
Level 1
Posts: 16
Joined: Mon Aug 28, 2017 11:10 am

Re: Editing fstab to mount partitions on a second hard drive

Post by terry_g » Thu Apr 19, 2018 11:58 pm

What does errors=remount-ro do?

Terry

User avatar
WharfRat
Level 20
Level 20
Posts: 11574
Joined: Thu Apr 07, 2011 8:15 pm

Re: Editing fstab to mount partitions on a second hard drive

Post by WharfRat » Fri Apr 20, 2018 12:10 am

terry_g wrote:
Thu Apr 19, 2018 11:58 pm
What does errors=remount-ro do?

Terry
If an error is detected it will remount the filesystem read only to prevent further corruption otherwise it will just mark the filesystem as erroneous and continue which is the default set in the superblock.
ImageImage

terry_g
Level 1
Level 1
Posts: 16
Joined: Mon Aug 28, 2017 11:10 am

Re: Editing fstab to mount partitions on a second hard drive

Post by terry_g » Fri Apr 20, 2018 9:23 am

Thanks For your help The partitions are mounting where I wanted them.
I transferred all my photos and important files into them there were over 16,000.

Terry

User avatar
WharfRat
Level 20
Level 20
Posts: 11574
Joined: Thu Apr 07, 2011 8:15 pm

Re: Editing fstab to mount partitions on a second hard drive

Post by WharfRat » Fri Apr 20, 2018 10:51 am

terry_g,

You might also consider setting the fs_passno to 2 and setting the Maximum mount count to 30 or so for periodic fsck during boot.
ImageImage

Post Reply

Return to “Mounting Partitions”