The Art of Mount

Source: Internet
Author: User
Tags ftp login

Before reading this article, I assume that you have some knowledge of the device command rules for hard disks and optical discs under Linux, such as the relationship between SDA and SDA1, and the devices such as HDA, SDA, FD, CDROM, and so on.

===

1 I plug the USB drive to the port, what can I do next to see the contents of the USB flash drive?

I'm not sure that your Linux system will automatically load. So, you should go to the/media directory and see if it has been loaded automatically. If so, there should be a directory in the/media, the name is similar to disk, you enter the directory is equal to enter your USB stick.

If/media doesn't have what you want, mount it yourself!

$mkdir/mnt/usb

$mount-T Vfat/dev/sda/mnt/usb

So, you go to the/MNT/USB directory to see, you should have what you want. If the mount command doesn't work, then you can change the/DEV/SDA to/dev/sdb or/DEV/SDC and try it!

The-t option is used to set the file system type, and I assume that your USB stick is FAT32. (because most USB drives are like this) if it's another file system, you can look at it in man mount, similar to the method.

2 I put the CD in the CD-ROM, what next?

If the system does not automatically load the optical drive, then the following command is generally valid:

$mkdir/mnt/cdrom

$mount-T Iso9660/dev/cdrom/mnt/cdrom

3 I downloaded a pes6.iso file, how do I load the ISO file?

$mount-O loop pes6.iso/mnt/cdrom

You can use the-o option and the loop parameter!

4 i downloaded 10 iso files from Fifa2000.iso to Fifa2009.iso, but when I mount to Fifa2007.iso, I'm prompted not to mount! How to solve?

This involves the principle of mount-o loop. If you look at the file that starts with loop in/dev, you'll find:

[Email protected] dev]$ ls/dev/loop*
/dev/loop0/dev/loop2/dev/loop4/dev/loop6
/dev/loop1/dev/loop3/dev/loop5/dev/loop7

Now you know, the original in/dev is only 8 presets to load the ISO place.

The solution is this:

You can use the Modinfo command to view the loop information first:

[Email protected] ~]# Modinfo loop
FileName:/lib/modules/2.6.26.5-45.fc9.i686/kernel/drivers/block/loop.ko
alias:block-major-7-*
License:gpl
Srcversion:7595f5d46dfdb4a2d489ddd
Depends
vermagic:2.6.26.5-45.fc9.i686 SMP mod_unload 686 4KSTACKS
Parm:max_loop:Maximum number of loop devices (int)
Parm:max_part:Maximum number of partitions per loop device (int)

Max_loop can be seen to limit the maximum number of loops. The Max_part is used to set the number of partitions that each loop's device can support.

You can also see that the control loop is a kernel module:/lib/modules/2.6.26.5-45.fc9.i686/kernel/drivers/block/loop.ko.

Our goal is to modify the Max_loop value.

$echo "Options Loop max_loop=20″>>/etc/modprobe.conf

Then just reload the kernel module to do this:

[Email protected] ~]# Modprobe-l|grep Loop.ko
/lib/modules/2.6.26.5-45.fc9.i686/kernel/drivers/block/cryptoloop.ko
/lib/modules/2.6.26.5-45.fc9.i686/kernel/drivers/block/loop.ko
[Email protected] ~]# Modprobe-r loop
[Email protected] ~]# Modprobe loop

Note the option of the Modprobe command-R means remove, which deletes a module.

OK, so we re-loaded the loop module, you can now use ls/dev/loop* to see if there are already 20 loop devices.

5 I know the contents of the/etc/fstab file are all the devices loaded at boot, so can mount use this file?

Can be used, you directly execute mount-a, Mount will obediently follow the contents of the/etc/fstab file to load all the devices.

6 I have different file systems here, what do I need to be aware of when I load with mount?

You need to add-T at mount to set the file system category:

If it is fat, it should be-t vfat;

If it is the EXT system of Linux, it should be-t ext or-t ext2 or-t ext3, the future will have-t ext4;

If it is an optical drive, that is-t iso9660;

If the file system is NTFS, then you may need to know about the NTFS-3G software.

7 I have an old three-inch floppy disk, if mount?

$mount-T Vfat/dev/fd0/mnt/floppy

8 Mount What else can I do besides loading the device?

Mount can be used to mount a partition that supports ACLs. You can query mount and ACL specifically.

Mount can be used to set the FTP login directory, which can be implemented with the –bind parameter.

Mount can set and modify the properties of the loaded file system to see the-o parameter of Mount.

The Art of Mount

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.