Jump to content

Photo

Modifing fstab

fstab

Best Answer cafaia , 14 August 2017 - 08:40 AM

Hello, fusion-cat!

 

You must do these steps:

~ $ su -
~ # cp -p /etc/fstab{,.bak}
~ # nano -w /etc/fstab

1ª step: you log in as root;

2ª step: you make a backup of the file;

3ª step: you open the file '/etc/fstab' with the editor 'nano'.

 

Then you should add something like this:

/dev/sdb1	/home	ext4	defaults,noatime	0 2

To exit the editor you must:

 

1º to press 'Ctrl+O' + 'Enter';

2º to press 'Ctrl+X'.

 

I hope I have helped!

Go to the full post »


7 replies to this topic

#1
fusion-cat

fusion-cat

    Newbie

  • Members
  • Pip
  • 4 posts

How can I modify fstab to have sdb1, my home partition in? It currently looks like this:

NOTE: dev/sdb1 is the home partition

# /etc/fstab: static file system information
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts
#
# See the manpage fstab(5) for more information
#
# <fs>               <mountpoint>     <type>          <opts>                    <dump/p$>
                     
/dev/sda1            /boot            ext2            noauto.noatime            1 2
/dev/sda2            none             swap            sw                        0 0
/dev/sda3            /                xfs             noatime                   0 1
/dev/sdb1            
#/dev/cdrom          /mnt/cdrom       auto            noauto,ro                 0 0


#2
cafaia

cafaia

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
✓  Best Answer

Hello, fusion-cat!

 

You must do these steps:

~ $ su -
~ # cp -p /etc/fstab{,.bak}
~ # nano -w /etc/fstab

1ª step: you log in as root;

2ª step: you make a backup of the file;

3ª step: you open the file '/etc/fstab' with the editor 'nano'.

 

Then you should add something like this:

/dev/sdb1	/home	ext4	defaults,noatime	0 2

To exit the editor you must:

 

1º to press 'Ctrl+O' + 'Enter';

2º to press 'Ctrl+X'.

 

I hope I have helped!



#3
fusion-cat

fusion-cat

    Newbie

  • Members
  • Pip
  • 4 posts

Does this look correct?:

/dev/sda1            /home            xfs            defaults,noatime0 2

When using nano, I am getting no space between the <opts> and <dump/p$> sections



#4
cafaia

cafaia

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Hello, fusion-cat!

 

Yes, if your home folder is /dev/sda1 and your file system is XFS.

There should be space between <opts> and <dump/p$> sections, you must click in 'Tab' for this.



#5
fusion-cat

fusion-cat

    Newbie

  • Members
  • Pip
  • 4 posts

So does everything in the file have to be inline with one another or not?



#6
cafaia

cafaia

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Hello, fusion-cat!

 

My file '/etc/fstab' is this:

/dev/md1                        /boot                   ext2    defaults,noatime                                        1 2
/dev/mapper/swsyho-swap         none                    swap    sw                                                      0 0
/dev/mapper/swsyho-system       /                       ext4    noatime                                                 0 1
/dev/mapper/swsyho-home         /home                   ext4    defaults,noatime                                        0 2
tmpfs                           /var/tmp/portage        tmpfs   uid=portage,gid=portage,mode=775,size=16384M,noatime    0 0

/dev/sdc1                       /hd                     ext4    defaults,noatime                                        0 2

I have everything aligned.



#7
fusion-cat

fusion-cat

    Newbie

  • Members
  • Pip
  • 4 posts

So I assume I should increase the spacing in the fstab file?



#8
cafaia

cafaia

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Hello, fusion-cat!

 

Yes, but that's my personal opinion.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users