Page 17 of 21 FirstFirst ... 71516171819 ... LastLast
Results 161 to 170 of 205

Thread: How to fstab

  1. #161
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How to fstab

    I posted a direct link on my server, here :

    http://bodhizazen.net/Tutorials/Understandingfstab.pdf
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  2. #162
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    688
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: How to fstab

    Hello again everyone.

    I've got another question about fstab and mounting new drives into given locations.

    this time related to virtual machines, but I'm not sure where to ask the question so I'm asking it here in the first instance.

    My VM is an ubuntu install on a vista terminal.

    I created the disk as what I thought was "automatically expandable" but it won't expand!

    Not a problem I thought, I can simply add an extra HDD and mount it to wherever I need it.... not so.

    When you mount a disk in a given location (eg /home/username ) any files or directories in that partition will dissappear! not helpfull!

    I am sure that they must be a way of making Ubuntu think that the new disk is actually part of the original disk? - essentially extending the disk size at a given mount point?

    I wonder if this is possible by using symbolic links?

    I have read about using the LVM (logical volume manager) but from what I have read it seems as though LVM will only work if you are installed from the < alternate install cd >. Other suggestions are too boot from the live CD, but this is a VM so I'm not sure that this will work!

    any advice will be eagerly asborbed.

    Thanks in advance.

    David
    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  3. #163
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to fstab

    Hi theDaveTheRave.
    You are correct: if you have files in /home/username on /dev/sdaX and then mount /dev/sdbY at /home/username, then the original files "disappear" (until you umount /dev/sdbY). The "mount" command does not merge directories together.

    Here are a few workarounds/options:
    • You could move everything in /home/username to a partition on the extra HDD. Then mount the partition at /home/username.
    • You could organize /home/username into a manageable number of directories: Docs, Music, Pictures, etc. Move those directories to a partition on the extra HDD. Then make symlinks from the partition back to /home/username:

      If the partition on the extra HDD is mounted at /mnt/data, then do, for example,
      Code:
      ln -s /mnt/data/Docs /home/username/Docs
      Note that the original directory /home/username/Docs must exist when your run the "ln -s" command, because the "ln -s" command creates a symlink called /home/username/Docs which points at /mnt/data/Docs. If there is a directory called /home/username/Docs then the "ln -s" command will fail to create the symlink.

      This option is particularly good if you are using more than one OS and want your data to be shared. Note that although data can be easily shared, configuration files may not be shareable. For example, if you have google earth version 4 on on OS and google earth version 5 on another, you may not be able to use the same ~/.googleearth configuration directory for both. Version 4's ~/.googleearth may cause Version 5 to crash...
    • I think if you really really wanted to, there is a way to setup /home/username on an LVM, but unless you plan on adding additional hard drives every month and want the additional space to be added seemlessly, I think setting up LVM would be more trouble than its worth. (On the other hand, it could just be my inexperience with LVM which is biasing my opinion!)
    Last edited by unutbu; July 22nd, 2009 at 04:24 PM.

  4. #164
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    688
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: How to fstab

    Unutbu

    I had thought it may be possible with the use of symlinks.

    However (and just because I want to add in a little bit of confusion) I will explain why I need to do this.

    I've been asked to create a virtual machine to hold a "dumbed down" version of a mysql database.

    The tables for mysql live in /var/lib/mysql

    I created the VM and it had the "normal" setup with apparently "automatically expandable HDD" which when I tried to load on the mysql tables didn't expand and promptly ran out of space!

    So now I need to add in a new Virtual HDD, which seems fine but I can't add a "logical Volume" into the system, and I can't use fstab to mount it either.

    this leads me nicely to my question.

    If I create a symbolic link (as you are suggesting) will that enable the mysql daemon to follow it automatically when adding in new tables / adding data to existing ones?

    Otherwise I had allready hit on the idea of simply copying everything over to the new disk, then de-import / re-import the relevant disks etc... which sounds far too complicated for my work colleagues!

    Ah well... only another 2 days and its the weekend....

    David
    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  5. #165
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to fstab

    theDaveTheRave, I don't have any experience with virtual machines.
    I hope someone with knowledge about this will chime in, especially if I'm making some mistake.

    Until then I'm going to ignore that you're dealing with a VM and assume things work the same as a normal installation.
    If I create a symbolic link (as you are suggesting) will that enable the mysql daemon to follow it automatically when adding in new tables / adding data to existing ones?
    I have some experience with this: I have /var/lib/mysql/MY_DB symlinked to /data/var/lib/mysql/MY_DB. /data is the mount point of a separate partition.

    Starting with Intrepid (or maybe Hardy), Ubuntu installs mysql-server with an apparmor profile called /etc/apparmor.d/usr.sbin.mysqld. This apparmor profile restricts the directories into which mysql can read/write. In order to enable mysqld to read /data/var/lib/mysql/MY_DB you must edit /etc/apparmor.d/usr.sbin.mysqld by adding lines like this:
    Code:
      /data/var/lib/mysql/ r,
      /data/var/lib/mysql/** rwk,
    After you make the symlink you should be able to access the database on the separate partition... Well, my notes are a little cloudy here. You may also need to restart the mysqld server and maybe also apparmor:
    Code:
    sudo /etc/init.d/apparmor restart
    sudo /etc/init.d/mysql restart
    Hope this helps.

  6. #166
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How to fstab

    I would look to see why your disk is full. Fix that problem (need a bigger disk ?).

    Your example can not be solved with fstab or links. IMO easiest to make a new disk. Boot your Vm with a "live CD" and copy your /old_disk to the /new_disk

    You might also want to look at LVM.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #167
    Join Date
    Jun 2007
    Location
    Puerto Rico
    Beans
    157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to fstab

    I think that I read this somewhere in this post but it will be good if it is included in the HowTo.

    When making a new dir with sudo, if the directory is made in /mnt it will not show up in "Places" or in the dialogs that look for a folder. The drive will be mounted but you will have to manually navigate to /mnt/SOMEFOLDER to access said drive. I for one like to have the drive listed in "Places" with the drive icon. To do that, a new dir should be mounted in /media. I just spent a couple of hours trying to figure this out thinking that the drive was not mounting. To follow your example:
    Code:
    sudo mkdir /media/SOMEFOLDER
    instead of
    Code:
    sudo mkdir /mnt/SOMEFOLDER
    The only benefit (that I can see) is that it will list the location as a drive in "Places", it will place an icon in the desktop and it will be accessible in the dialogs that ask the user where to save or what folder/file to open instead of the user having to navigate to /mnt/SOMEFOLDER.
    ¡Levántate!, ¡Revuélvete!, ¡Resiste!
    Haz como el toro acorralado: ¡muge!
    O como el toro que no muge: ¡EMBISTE!
    - José de Diego, En la brecha -

  8. #168
    Join Date
    Feb 2009
    Beans
    190

    Re: How to fstab

    Hopefully this thread is still active and someone can help.

    Here's my puzzle:

    I have a second hard disc sdb1 I use to store data and programs on.
    To create it, I formatted it to ext3 and did:

    Code:
    sudo chown -R myName:myName /media/Data
    sudo chmod -R 755 /media/Data
    I could happily read & write the disc, but I found I could not run any programs stored on it. So I added 'exec' to the fstab entry like this:


    Code:
    /dev/sdb1                                  /media/Data    ext3         defaults,users,exec                 0  0
    But the disc still does not execute programs, even after a reboot. What is wrong?

  9. #169
    Join Date
    Feb 2009
    Beans
    190

    Re: How to fstab

    Actually, adding exec does seem to have done the trick. I mistakenly tried running a .exe file as a test - which just threw up the archive manager, so I assumed things weren't working.

    Other binaries now do run - as do bash scripts (which gave a confusing error message before).

    Now is that fstab line secure, in the sense that is 'nosuid' enabled?

    I don't want a rogue binary have access to things I can't normally access.

    I thought 'defaults' enabled 'suid'.

    What's the recommended way here?

  10. #170
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How to fstab

    I advise you use the options noexec and nosuid

    If you want a binary, keep it in ~/bin rather then the data partition.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Page 17 of 21 FirstFirst ... 71516171819 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •