-
mount
Dear List,
I want to mount one of hard disk on my system to a location where I perform some calculations and I get the following message:
First of all here is the output of df command on my computer:
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdc1 71630348 43685764 24247228 65% /
tmpfs 1035848 0 1035848 0% /dev/shm
/dev/sdb1 158309288 192676 150074880 1% /mnt/sdb1
/dev/sda1 158309288 192672 150074884 1% /mnt/sda1
Here is the mount command and the message:
# mount /mnt/sdb1/siavoush/ /home/babak/testdir/
mount: /mnt/sdb1/siavoush/ is not a block device
I will appreciate it if you let me know what I should do. In fact I am doing some calculations in a directory called:
/home/siavoush/MM-PBSA/1ivo
I think I am running out of space and my calculation stops for no obvious reason. As you can see I have two hard disks which are empty and I want to use the space on these disks. If I am correct, from df command I can see that my first hard disk "i.e., /dev/sdc1" is 65% full. I don't know how much of the remaining space is available for my calculations when I run programs in /home/siavoush/MM-PBSA/1ivo. And the question is how can I use the space from other disks? Is the mount right tool to do this? Is this the right way to expand the available space for my calculations from where I issue the commands?
Many thanks for your kind attentions in advance.
Cheers, Siavoush
-
You always mount a "hardware" on a Linux filing tree.
The hardware is one with a device name like /dev/sda1 which is a block device.
You can't mount one branch of a filing system tree to another branch, as /mnt and /home are already parts of the filing system tree.
I recommend using the same partition numbering so to mount /dev/sdb1 the commands should be (assuming /mnt/sdb1 has not been created yet)
Code:
mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1
Thereafter you should see all the files in /mnt/sdb1 by command
Last edited by saikee; 04-10-2009 at 08:40 AM.
-
Thanks Saikee,
Is there any way then to expand the space available for a directory like /home/siavoush/MM-PBSA/1ivo ? If I mount /dev/sdb1 to /home/siavoush/MM-PBSA/1ivo then all the content of directory /home/siavoush/MM-PBSA/1ivo will be saved on my second hard disk which is device /dev/sdb1. Is this right? How about the permission? Can I use this space as a user siavoush (not the root)? Is that possible to change the permission so that the user siavoush (but not the others) can write on it? How about if I use programs which writes out the output in this directory which is mounted to /dev/sdb1? I ask these questions because I so illiterate about the Linux.
Cheers, Siavoush
-
Only root can mount partitions.
You can also in a root console alter the permission or ownership of a subdirectory. This command will change the ownership of everything inside /mnt/any to the user saikee
Code:
chown -R saikee /mnt/any
The transfer of files may take place at the background and there may be a time delay so to make sure the files are transferred do a "umont" (not unmount!). In umount you can either unmount the device or the branch in the filing tree. Either way will force the kernel to finish the work.
Mounting a device on a system filing tree is one of the wonders in Linux. Enjoy it!
-
I like to create directories in my files system expressly for use as mountpoints, amd I keep the names as simple as possible, as in:
blackbox@debian1:~$ mkdir /1 /2 /3 /4
I check my disks like so:
blackbox@debian1:~$ sudo fdisk -l
and the output is:
Disk /dev/hda: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b67f8
Device Boot Start End Blocks Id System
/dev/hda1 1 97 779121 5 Extended
/dev/hda2 98 1921 14651280 83 Linux
/dev/hda3 1922 2018 779152+ 82 Linux swap / Solaris
/dev/hda4 2019 14946 103844160 83 Linux
/dev/hda5 1 97 779089+ 82 Linux swap / Solaris
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00065b1f
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6079 48829536 83 Linux
/dev/sda2 6080 6322 1951897+ 82 Linux swap / Solaris
/dev/sda3 6323 60801 437602567+ 83 Linux
The sda, the last part of the output, is my usb hard drive which is unmounted. I mount the partition that I want:
blackbox@debian1:~$ sudo mount /dev/sda3 /1
And from that point on, the location of the hard drive is a nice simple /1
blackbox@debian1:~$ cd /1
is all it takes to get me into that partition. Or clicking there.
Sure, it's little to click, and almost nothing to type and remember, but the best part is that even though unplugging and and replugging the USB hard drive without rebooting will change the disk from sda to sdb, then to sdc, and so on, the manually engaged mount point /1 remains the same for each mounting, and this allows me to use the address /1 as a constant in scripts and desktop icons... i.e., "launchers" (as they're called in gnome) or "links to location" or "links to application" (as they're called in KDE.) Obviously, these are only valid when the partition is mounted.
Last edited by blackbelt_jones; 04-14-2009 at 11:23 AM.
-
Originally Posted by saikee
You always mount a "hardware" on a Linux filing tree.
The hardware is one with a device name like /dev/sda1 which is a block device.
You can't mount one branch of a filing system tree to another branch, as /mnt and /home are already parts of the filing system tree.
Actually Saikee, yes you can do exactly that using mount's bind option.
Siavoush, just modify your original command by adding --bind to it and you'll get the result you originally wanted e.g.
Code:
mount /mnt/sdb1/siavoush/ /home/babak/testdir/ --bind
-
man mount
Code:
Since Linux 2.4.0 it is possible to remount part of the file hierarchy
somewhere else. The call is
mount --bind olddir newdir
After this call the same contents is accessible in two places. One can
also remount a single file (on a single file).
This call attaches only (part of) a single filesystem, not possible
submounts. The entire file hierarchy including submounts is attached a
second place using
mount --rbind olddir newdir
Note that the filesystem mount options will remain the same as those on
the original mount point, and cannot be changed by passing the -o
option along with --bind/--rbind.
-
retsaw & mrrangerman43
Thanks for the tips. I was uncertain at the time I wrote my reply. I did mount with bind before but not frequent enough.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|