How To Install Slax On Usb Drive

How To Install Slax On Usb Drive 3,5/5 7364 votes

Slax is a great LiveCD linux distribution based on Slackware that fits in. This guide shows you how to install Slax linux to a USB memory stick.

Mount is a command used in Linux to attached filesystems and drives and umount command is used to detach (unmount) any attached file systems or devices.

In this tutorial, we will learn how to mount (attach) a drive in Linux with the EXT Linux file system, FAT or NTFS using mount command. We can use the same command to mount the USB drive and ISO image as well.

On both Linux and UNIX like operating systems we can use mount/umount command to attach/detach devices.

List Mounted File Systems and Linux Drives

To display all currently attached file systems we will type:

Slax

By default, the output will include all of the file systems including the virtual ones such as cgroup, sysfs, and others. Each line contains information about the device name, the directory to which the device is mounted, the filesystem type and the mount options.

To list only certain types of file systems we will use -t option:

Listing only ext4 Linux file system will usually display our Linux drives.

You can use fdisk to have an idea of what kind of Linux partitions and devices you have, for example:

On my Fedora Linux computer, we can see a different drive configuration:

Now when I insert USB flash drive, we get another bit of information with fdisk -l:

This is important when we need to find which partition we wish to mount (attach) or detach. In this case, we see the USB drive is /dev/sdb1.

Reading mount options from a drive

We can use mount -t command to list the drive mount options. USB drive I inserted before was auto-mounted, and we saw that the filesystem is VFAT.

We see that the USB drive (partition) is mounted as /dev/sdb1 on /run/media/slax/tribal.

You can read about specific options in mount man page.

Mounting a Linux FileSystem

To mount a drive we need to assign it a root directory (mounting point) with mount command in the following format:

Usually, the mount command will auto-detect the filesystem type, but some filesystems are not recognized and need to be specified as a parameter.

Use the -t option to specify the file system type:

To specify additional mount options, you can use the -o option: Ye rista kya kahelata hai.

You can use multiple options by separating them with a comma (do not insert a space after a comma).

Mounting Linux USB Drive

So first we need to create a mount point (directory):

Next, we mount the drive to /media/myusb:

With dh -H we can see on the last line that our USB device is mounted successfully.

Mounting a FileSystem using /etc/fstab file

Mounting points and their options configured in /etc/fstab will automount upon system start.

The /etc/fstab file contains a list of entries in the following form:

Here is the sample /etc/fstab file from my computer:

So you can add an entry, and configure mounting point in /etc/fstab to have it always mounted on system boot.

Mounting NFS Share

NFS stands for Network File System. To mount an NFS share you'll need to have the NFS client package installed on your Linux system.

To install NFS client on Ubuntu and Debian, type:

To install NFS client on CentOS and Fedora:

As we have seen in my sample /etc/fstab file entries before, I already have an NFS share configured on my computer:

You can add an entry to /etc/fstab on your computer using Nano or Vim, and enter the URL path to your remote NFS shared directory and a local mounting point (directory) which will be used to access the remote files.

Mounting ISO Files

You can mount an ISO file using the loop device which is a special pseudo-device that makes a file accessible as a block device.

Start by creating the mount point, directory to be used with ISO file:

Mount the ISO file to the mount point by typing the following command:

In the sample command above, path_to_image.iso is the path to your ISO file, of course.

Unmounting a File System

To detach a mounted filesystem, use the umount command followed by either the directory where it has been mounted (mount point) or the device name. If we use the USB drive from before as a sample, the commands would look like this:

If the file system is in use the umount command will fail to detach the file system.

Lazy unmount

Use the -l (--lazy) option to unmount a busy file system as soon as it is not busy anymore.

Force unmount

Use the -f (--force) option to force an unmount. This option is usually used to unmount an unreachable NFS system. In the case of my NFS Share, the command would be:

It is not a good idea to force unmount as it may corrupt the data on the file system.

Conclusion

By the end of this tutorial, you should have a good understanding of how to use the mount and umount command to attach and detach various file systems. We have also seen how to achieve that in various ways and with several media options like ISO file, NFS share and USB flash drive.

  1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Discussion in 'Linux and Unix' started by jrbuergel, Apr 13, 2009.

Thread Status:
Not open for further replies.

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/818232