Results 1 to 8 of 8

Thread: Mounting second drive within file system

  1. #1
    Join Date
    Mar 2006
    Location
    St.Austell Cornwall
    Beans
    206
    Distro
    Ubuntu Mate Development Release

    Question Mounting second drive within file system

    I have two hard drives in my desktop, a 250GB and 500GB.

    The first drive has the swap and / the second drive is just sat there having to be mounted before use. I have a half remembered thought that the second drive could be given a mount point within the file system. I have often partitioned drives so that / is septate to /home but not over different phisical drives. I wouldn't want the 500GB to be /home because a large chunk of the 250GB would not normally be used.

    What I would like is to have the first drive set 20GB / the rest to /home. Then the 500GB set to /home/data so it would apear within the home directory or even better /home/user/data as I'm the only user of the computer.

    Secondary question, would there be any advantage of putting the swap on the second drive? right at the outer edge short stroking??
    PendragonUK
    Middle aged geek, Clan Admin, PC-gamer, Freelance-nerd.
    Twitter / Google+

  2. #2
    Join Date
    Feb 2010
    Location
    Minneapolis, Minnesota US
    Beans
    166
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Mounting second drive within file system

    Well...I'm a little lost as far as what you're trying to do. A df -h output would help us understand how you're currently setup.

    Also an fdisk -l for each drive would be handy too.

  3. #3
    Join Date
    Mar 2010
    Location
    ρθΦ=000
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Mounting second drive within file system

    Just to make sure I'm understanding you correctly, you want to have your 2nd physical hard drive mounted automatically at the place listed in your post, correct?

    If so, you'll want to add an /etc/fstab entry. If you want to work through it yourself, you can click the fstab link in my signature, please post the output of the below commands for us to help you:

    Code:
    sudo fdisk -l
    mount
    sudo blkid
    Placing swap on the 2nd drive would speed things up a tiny bit only if your computer routinely accesses the swap space.

  4. #4
    Join Date
    Mar 2006
    Location
    St.Austell Cornwall
    Beans
    206
    Distro
    Ubuntu Mate Development Release

    Re: Mounting second drive within file system

    The output from df -h

    Code:
    stevem@stevem-desktop:~$ df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda1             227G   16G  200G   8% /
    none                  494M  716K  494M   1% /dev
    none                  501M  1.3M  500M   1% /dev/shm
    none                  501M  360K  500M   1% /var/run
    none                  501M     0  501M   0% /var/lock
    /dev/sdb1             459G  137G  299G  32% /media/Data
    df: `/root/.gvfs': Permission denied
    There are two phisical drives, I would like the second, larger drive to mount within the file system of the first smaller one. So when looking in my user directory the drive would behave like a directory. When we format our drives when installing we select the mount point (/, /home, /var, /tmp, etc) I would like to set the mount point of the second drive to be /home/user/data in my case /home/stevem/data.
    PendragonUK
    Middle aged geek, Clan Admin, PC-gamer, Freelance-nerd.
    Twitter / Google+

  5. #5
    Join Date
    Mar 2006
    Location
    St.Austell Cornwall
    Beans
    206
    Distro
    Ubuntu Mate Development Release

    Re: Mounting second drive within file system

    Code:
    Disk /dev/sda: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 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: 0x00046432
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       30028   241193984   83  Linux
    /dev/sda2           30028       30402     3002369    5  Extended
    /dev/sda5           30028       30402     3002368   82  Linux swap / Solaris
    
    Disk /dev/sdb: 500.0 GB, 499971544064 bytes
    255 heads, 63 sectors/track, 60784 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: 0x8969a6e5
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1       60784   488247448+  83  Linux
    stevem@stevem-desktop:~$
    PendragonUK
    Middle aged geek, Clan Admin, PC-gamer, Freelance-nerd.
    Twitter / Google+

  6. #6
    Join Date
    Mar 2010
    Location
    ρθΦ=000
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Mounting second drive within file system

    You didn't post the output of

    Code:
    sudo blkid
    so we'll have to use /dev/sdXY versus the drive UUIDs, and start with a guess that it is formatted in ext4:

    Add the mount point

    Code:
    mkdir ~/data
    Open /etc/fstab for editing

    Code:
    sudo gedit /etc/fstab
    Add the following line at the bottom, save the file and quit

    Code:
    #Entry for /dev/sdb1
    /dev/sdb1     /home/stevem/data      ext4     defaults     0     2
    The logoff and logback in (or restart), check to ensure it is mounted correctly

  7. #7
    Join Date
    Mar 2006
    Location
    St.Austell Cornwall
    Beans
    206
    Distro
    Ubuntu Mate Development Release

    Re: Mounting second drive within file system

    I had a look at the link in your sig and installed PySDM, and managed to get it sorted...

    I have a directory called Data within my /home/user directory and when I look in it I see the contents of the second large hard drive.

    This is what I had wanted to acheave.

    Thanks for your help I can put this one down as solved
    PendragonUK
    Middle aged geek, Clan Admin, PC-gamer, Freelance-nerd.
    Twitter / Google+

  8. #8
    Join Date
    Mar 2010
    Location
    ρθΦ=000
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Mounting second drive within file system

    Easy enough, glad its working!

    If in the future you want to add NTFS drives automatically, the tool I suggest it NTFSConfig

    Code:
    sudo apt-get install ntfsconfig

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
  •