Hints and Tips Topic
   >  Mounting a New File System
   >  File System will not Mount
   >  Using Symbolic Links
   >  Kernel Panic - not syncing VFS
   >  Unmounting a File System

 

Mounting a New File System on Linux

How to Mount a New File System

If you need to add an additional disc drive, then once you have formatted it (-e.g. in ext3 or ext4 format) you'll need to mount it before Linux can see it. This section shows you how to do this.

If you need to add an additional disc drive, then once you have formatted it .. you'll need to mount it before Linux can see it

First, bring up a command line and issue the following command (-as root) to list out the available discs on the system:

$ sudo fdisk -l

You should get an output something like as follows:

Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b24fe

   Device       Boot      Start         End        Blocks        Id     System
/dev/sda1       *            1               13         96256       83    Linux
/dev/sda2                  13           3996    31998977        5    Extended
/dev/sda5                  13             262      1998848      82    Linux swap / Solaris
/dev/sda6                262           3996    29999104      83    Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007zx3e

   Device       Boot      Start         End         Blocks      Id     System
/dev/sdb1                     1        24316   195312640    83     Linux

Look through the listed devices (-the size shown in blue should help you here) and identify the new device. Let's assume that the new device is the 500Gb one shown above as /dev/sdb. What we need to do is append an entry to the /etc/fstab file, in the following format:

<device> <directory to mount as> <format> <Mount Option> <dump Option> <fsck Order>

For example:

$ vi /etc/fstab
<...... existing /etc/fstab contents .......>
# John Smith - mount data filesystem
/dev/sdb1 /mydata ext4 defaults 0 0

Where:

  • The device name (-from the fdisk command) is: /dev/sdb1
  • The directory we want to access the disc as is: /mydata
  • The format of the filesystem is: ext4
  • The default options apply for this disc
  • The contents of the disc should not be backed up
  • The contents of the disc should not be checked by fsck at boot time

Save this and then issue the following command to mount all the devices specified in the /dev/sdb file:

$ mount -a

Note: like all system administration functions, you will need to assume root before running any of the above


HomeSite IndexDesktop GuideServer GuideHints and TipsHardware CornerVideo SectionContact Us

 sitelock verified Firefox Download Button