1

I am adding an additional hard drive following this guide which uses gparted. https://help.ubuntu.com/community/InstallingANewHardDrive

However there is a portion I dont understand (sorry I am very much a beginner):

after sudo nano -Bw /etc/fstab

it mentions adding the code below

  /dev/sdb1    /media/mynewdrive   ext3    defaults     0        2

Specifically I want to know what I should use after /dev/***. The guide uses sbd1. Also what are the 0 2 for? I want to make sure that this does not alter anything that I currently have.

  • man fstab should explain everything in detail. – Wayne Vosberg Sep 23 at 6:27
  • man fstab is the command to display the reference manual page for fstab (or file system table). It's a reference manual for your system. Field 5 is the dump parameter (use 0 as it's very rarely used), Field 6 is a fsck (file system check) parameter for ordering; 0 usually for key system drives, 2 for less system-critical data drives. Rather than a device (/dev/sdb1) I'd suggest using the UUID (unique ID) which you can get from blkid once formatted; I'd also use ext4. sda = first drive, sdb=second drive, the number is partition - but these values can change if you change BIOS/hw – guiverc Sep 23 at 8:25
  • Thank you so much! – MikeDoho Sep 23 at 13:10
1

Yes as per first comment, you can get full details with man fstab, or the command to display the reference manual page for fstab (file system table).

man fstab will tell you

   The fifth field (fs_freq).
          This  field  is used by dump(8) to determine which filesystems need to be dumped.  Defaults to zero (don't
          dump) if not present.

   The sixth field (fs_passno).
          This field is used by fsck(8) to determine the order in which filesystem checks are  done  at  boot  time.
          The  root filesystem should be specified with a fs_passno of 1.  Other filesystems should have a fs_passno
          of 2.  Filesystems within a drive will be checked sequentially, but filesystems on different  drives  will
          be  checked  at  the  same time to utilize parallelism available in the hardware.  Defaults to zero (don't
          fsck) if not present.

Field 5 is the dump parameter (use 0 as it's very rarely used)

Field 6 is a fsck (file system check) parameter for ordering; 0 usually for key system drives, 2 for less system-critical data drives.

Rather than a device (/dev/sdb1) I'd suggest using the UUID (unique ID) which you can get from blkid once formatted; I'd also use ext4. sda = first drive, sdb=second drive, the number is partition - but these values can change if you change BIOS/UEFI/settings or add/change hardware.

eg.

guiverc@d960-ubu2:/var/crash$   sudo blkid
/dev/sda2: UUID="4f59600e-1f6b-4e3a-a466-941a2168e327" TYPE="swap" PARTUUID="6c8394c6-02"
/dev/sda1: UUID="afa7971f-3dd5-4b30-9c98-0af3e56a6f2b" TYPE="ext4" PARTUUID="6c8394c6-01"
/dev/sda4: UUID="06863296-81b3-4263-8665-21f1864fa399" TYPE="xfs" PARTUUID="6c8394c6-04"
/dev/sda5: UUID="5b4267e5-8b90-4f6b-84b0-c4ee9d5e104d" TYPE="ext4" PARTUUID="6c8394c6-05"
/dev/sda6: UUID="ba0dca2e-0799-4340-b565-a649842c8a69" TYPE="xfs" PARTUUID="6c8394c6-06"

results in a file system entry for one of my partitions as

UUID=ba0dca2e-0799-4340-b565-a649842c8a69       /more           xfs             defaults        0 2

/more is what I've called "more space", which in my case is an encrypted (XFS not EXT) home partition for my other [dual-booted] Ubuntu system. The UUID or Universally Unique Identifier being much more exact than sda6 which is all lsblk would tell me

guiverc@d960-ubu2:/var/crash$   lsblk
   ..redacted as only for example ..
└─sda6   8:6    0  53.8G  0 part /more
  • +1, particularly for "Rather than a device (/dev/sdb1) I'd suggest using the UUID (unique ID) which you can get from blkid once formatted; I'd also use ext4." – sudodus Sep 23 at 8:41
  • so I would want to add UUID=*** /media/mynewdrive ext4 defaults 0 2 ? – MikeDoho Sep 23 at 13:14
  • Yep, assuming *** was your valid UUID – guiverc Sep 23 at 21:52
  • worked like a charm. You all are awesome! – MikeDoho Sep 24 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.