Nees some help with hdds
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 28
  1. #1
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Nees some help with hdds

    hi all i have a bit of a sticky situation.

    i have two hard drives connected to my system
    they are both mounted as follows

    /mnt/storage
    /mnt/hshdd

    my storage drive is also bound to /yhn/home/media as that's my chroot jail for ssh/sftp

    i need the contents of /mnt/hshdd/forexampletv
    and /mnt/hshdd/forexamplefilms

    to show up in /yhn/home/media/forexampletv
    and /yhn/home/media/forexamplefilms

    so that all the media is displayed as if it was all in one folder.

    i cant figure out how to do this

  2. #2
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    ok so ive done some reading it looks like the best way is to convert my ext4 file systems the brtsfs file system.

    how exactly do i do that and set it up to achieve the goal of mounting the contents of the second hdd into the chroot jail so all the media is displayed in one folder

    e.g

    Films
    ------film folder one
    ------film folder two
    ------ film folder three
    etc

  3. #3
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    just to be clear on what i need.

    Basically i run a media server for myself and my folks which we access via ssh into a chrootjail.

    my hard drives are mounted like this

    /dev/sdb /mnt/storage defaults none 0 0

    /dev/sdbc /mnt/hshdd defaults none 0 0
    #### bind for chrootjail ########
    /mnt/storage /yhn/home/media

    what im looking for is to have the content of /mnt/storage/films & /mnt/hshdd/films

    to be displayed and accesable in /yhn/home/media/films.

    i know i cant do this using the ext4 file system ive been told brtsfs can handel this.

    i need to do this without Erasing any data on /dev/sdb or /dev/sdbc or my main os drive.

    A: how do i install and set up the brtsfs

    B: how do i get the outcome i need

    NB my mount points might be off im just going from memory

  4. #4
    Join Date
    Jul 2005
    Age
    58
    Posts
    1,214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    Why not just mount the drives where you want them in the first place? Drives can be mounted anywhere. They don't have to be mounted under /mnt. Or perhaps set up a bind mount like is done for nfs exports.

    Something like this in fstab along with the normal mount

    /mnt/hshdd/forexampletv /yhn/home/media/forexampletv none bind

  5. #5
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    Quote Originally Posted by William Haller
    Why not just mount the drives where you want them in the first place? Drives can be mounted anywhere. They don't have to be mounted under /mnt. Or perhaps set up a bind mount like is done for nfs exports.

    Something like this in fstab along with the normal mount

    /mnt/hshdd/forexampletv /yhn/home/media/forexampletv none bind
    i was trying with fstab before i posted and i couldn't get it to work ill try the above when im back home

  6. #6
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    here is my fstab file.

    Code:
    #
    # /etc/fstab
    # Created by anaconda on Mon Mar 11 17:19:07 2019
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/fedora_localhost--live-root /                       ext4    defaults        1 1
    UUID=a8703b97-8dcf-40b2-9e4d-b00d90aed7c9 /boot                   ext4    defaults        1 2
    /dev/mapper/fedora_localhost--live-home /home                   ext4    defaults        1 2
    /dev/mapper/fedora_localhost--live-swap swap                    swap    defaults        0 0
    /dev/sdc1 /mnt/storage                                          ext4    defaults        0 0
    
    
    ### Mount-point for Media for CHROOT JAILED SFTP USERS ###
    /mnt/storage/TV /yhn/home/media/TV                              none    bind            0 0
    /mnt/storage/Films /yhn/home/media/Films                        none    bind            0 0
    /mnt/hshdd/TV /yhn/home/media/TV                                none    bind
    /mnt/hshdd /yhn/home/media/Films                                none    bind
    /dev/disk/by-uuid/578221ed-ec50-4da5-8255-cc68e5b7b92e /mnt/hshdd auto nosuid,nodev,nofail,x-gvfs-show 0 0
    the drive is mounted at the correct point /mnt/hshdd, but the system is not binding the folders to the correct place i get the contents of the first drive but not the second, have i goosed something in my fstab file or am i missing something elce

  7. #7
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    In the directory where you want hdd storage mounted,
    mkdir /yhn/storage
    you can get the UUID to the hdd called storage and add the following to the fstab
    and extract the UUID info from the output
    sudo blkid * | grep storage
    sudo blkid * | grep films

    UUID=[the storage UUID] /yhn/storage ext4 defaults 0 0
    mkdir films in the /yhn
    UUID=[the films UUID] /yhn/films ext4 defaults 0 0

    They will be mounted at boot time
    If you do not want them mounted at boot time, but when you want, then for example add noauto,user where shown below.
    UUID=[the films UUID] /yhn/films ext4 defaults,noauto,user 0 0

    It will be mounted with when you issue the "mount /yhn/films" command
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  8. #8
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    Quote Originally Posted by lsatenstein
    In the directory where you want hdd storage mounted,
    mkdir /yhn/storage
    you can get the UUID to the hdd called storage and add the following to the fstab
    and extract the UUID info from the output
    sudo blkid * | grep storage
    sudo blkid * | grep films

    UUID=[the storage UUID] /yhn/storage ext4 defaults 0 0
    mkdir films in the /yhn
    UUID=[the films UUID] /yhn/films ext4 defaults 0 0

    They will be mounted at boot time
    If you do not want them mounted at boot time, but when you want, then for example add noauto,user where shown below.
    UUID=[the films UUID] /yhn/films ext4 defaults,noauto,user 0 0

    It will be mounted with when you issue the "mount /yhn/films" command
    i think you've miss understood my hdds are like this

    OS drive
    Storage
    hshdd

    storage is mounted in /mnt/storage and binded to /yhn/home/media for ssh access.

    i need the contents of two folders on /hshdd to be accessible from the chroot jail i.e /yhn/home/media

    so its like this

    Os drive
    /mnt
    /mnt/storage
    /mnt/storage/tv
    /mnt/storage/films

    /mnt
    /mnt/hshdd
    /mnt/hshdd/tv
    /mnt/hshdd/films

    /yhn
    /yhn/home
    /yhn/home/media
    /yhn/home/media/tv (contents of storage tv and hshdd tv to be displayed here)
    /yhn/home/media/films contents of storage films and hshdd films to be displayed here)

  9. #9
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    the TV and Film folders are both in the root of the Storage and hshdd drives respectively

  10. #10
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    What's pecking at my head is it did work in a previous fedora release bi think 27 or 28 but now the os will pick one of the drives and displays its contents in the chrootjail unless i comment out the hshdd fstab line

  11. #11
    Join Date
    Jul 2005
    Age
    58
    Posts
    1,214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    Try using the bind option by just specifying the folders you want. You don't have to bind the entire drive.

  12. #12
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    Quote Originally Posted by William Haller
    Try using the bind option by just specifying the folders you want. You don't have to bind the entire drive.
    could you give me an example please

  13. #13
    Join Date
    Jul 2005
    Age
    58
    Posts
    1,214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    From the looks of what you've posted, you've tried what I suggested already (the /mnt/hshdd/TV /yhn/home/media/TV none bind) line. So another thought would be is SELinux preventing you from doing what you want? grep on /mnt or /home/media in /var/log/audit/* and see if anything turns up.

    Just to be sure I made a directory in my home.. /home/xxxxx/tmp and mounted a lizardfs subdirectory that was also on the machine on it as root with... mount -o bind /lizardloc/subdir /home/xxxxx/tmp and it worked fine - no errors, and listing tmp showed the contents of the subdir I mounted. The only thing different was I was not doing any chroot stuff. This was tried on both 28 and 29 and worked in both places. The thing about chroot is that all of the files and programs that you need to do operations while in a chroot jail have to exist in the chroot environment. Is something missing in the chroot area?
    Last edited by William Haller; 11th April 2019 at 07:22 PM. Reason: Additional testing done

  14. #14
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    Quote Originally Posted by William Haller
    From the looks of what you've posted, you've tried what I suggested already (the /mnt/hshdd/TV /yhn/home/media/TV none bind) line. So another thought would be is SELinux preventing you from doing what you want? grep on /mnt or /home/media in /var/log/audit/* and see if anything turns up.

    Just to be sure I made a directory in my home.. /home/xxxxx/tmp and mounted a lizardfs subdirectory that was also on the machine on it as root with... mount -o bind /lizardloc/subdir /home/xxxxx/tmp and it worked fine - no errors, and listing tmp showed the contents of the subdir I mounted. The only thing different was I was not doing any chroot stuff. This was tried on both 28 and 29 and worked in both places. The thing about chroot is that all of the files and programs that you need to do operations while in a chroot jail have to exist in the chroot environment. Is something missing in the chroot area?
    ill check the log and see if anything turns up,

    the chroot jail is complete as far as i can tell its stange will mirror the first HDD but wont mirror two directory on two separate hdds

  15. #15
    Join Date
    Jan 2017
    Location
    United Kingdom
    Age
    30
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nees some help with hdds

    i noticed my fstab file was a bit messed up so ive cleaned it up and added some comments to better explain things in there

    Code:
    #
    # /etc/fstab
    # Created by anaconda on Mon Mar 11 17:19:07 2019
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    ## Below are the System generated mount points for the OS hard disk and storage drives ########
    #
    #
    /dev/mapper/fedora_localhost--live-root /                       ext4    defaults        1 1
    UUID=a8703b97-8dcf-40b2-9e4d-b00d90aed7c9 /boot                 ext4    defaults        1 2
    /dev/mapper/fedora_localhost--live-home /home                   ext4    defaults        1 2
    /dev/mapper/fedora_localhost--live-swap swap                    swap    defaults        0 0
    /dev/disk/by-uuid/578221ed-ec50-4da5-8255-cc68e5b7b92e /mnt/hshdd auto nosuid,nodev,nofail,x-gvfs-show 0 0
    /dev/sdc1 /mnt/storage                                          ext4    defaults        0 0
    
    
    
    
    
    
    ### Mount-point for Media for CHROOT JAILED SFTP USERS Note: The chroot Jail is READ-ONLY Please use /mnt/storage & /mnt/hshdd to Add  content ###
    
    
    /mnt/storage/TV /yhn/home/media/TV                              none    bind            0 0
    /mnt/storage/Films /yhn/home/media/Films                        none    bind            0 0
    /mnt/hshdd/TV /yhn/home/media/TV                                none    bind            0 0
    /mnt/hshdd /yhn/home/media/Films                                none    bind            0 0
    I checked the audit log and i found this.

    Code:
    [root@localhost audit]# grep /mnt /var/log/audit/*
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554886478.554:247): pid=3314 uid=1000 auid=1000 ses=2 msg='cwd="/mnt" cmd=6D6B646972206873686464 terminal=pts/1 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554903076.005:3208): pid=6694 uid=1000 auid=1000 ses=14 msg='cwd="/mnt/hshdd/Films" cmd=6E616E6F202F6574632F6673746162 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554903111.382:3228): pid=7403 uid=1000 auid=1000 ses=14 msg='cwd="/mnt/hshdd/Films" cmd=73687574646F776E202D72 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554903118.763:3234): pid=8113 uid=1000 auid=1000 ses=14 msg='cwd="/mnt/hshdd/Films" cmd=73687574646F776E202D63 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554903124.859:3240): pid=8826 uid=1000 auid=1000 ses=14 msg='cwd="/mnt/hshdd/Films" cmd=736875646F776E202D72206E6F77 terminal=pts/0 res=failed'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554903130.035:3242): pid=8997 uid=1000 auid=1000 ses=14 msg='cwd="/mnt/hshdd/Films" cmd=73687574646F776E202D72206E6F77 terminal=pts/0 res=success'
    [root@localhost audit]#
    Code:
    [root@localhost audit]# grep /home/media /var/log/audit/*
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554889786.421:259): pid=2761 uid=1000 auid=1000 ses=2 msg='cwd="/yhn/home/media/TV" cmd=6E616E6F202F6574632F6673746162 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554889818.786:284): pid=3504 uid=1000 auid=1000 ses=2 msg='cwd="/yhn/home/media/TV" cmd=6E616E6F202F6574632F6673746162 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554889921.854:290): pid=4196 uid=1000 auid=1000 ses=2 msg='cwd="/yhn/home/media/TV" cmd=73687574646F776E202D72206E6F77 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554890104.123:255): pid=2803 uid=1000 auid=1000 ses=2 msg='cwd="/yhn/home/media/TV" cmd=6E616E6F202F6574632F6673746162 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554890718.187:272): pid=3559 uid=1000 auid=1000 ses=2 msg='cwd="/yhn/home/media/TV" cmd=6C6E202D73202F6D6E742F68736864642F5456202F79686E2F686F6D652F6D656469612F5456 terminal=pts/0 res=success'
    /var/log/audit/audit.log.4:type=USER_CMD msg=audit(1554890739.625:278): pid=4260 uid=1000 auid=1000 ses=2 msg='cwd="/yhn/home/media/TV" cmd=6C6E202D73202F6D6E742F68736864642F54562F202F79686E2F686F6D652F6D656469612F5456 terminal=pts/0 res=success'
    [root@localhost audit]#


    if everything is going according to plan why are the files in hshdd not showing up in /yhn/home/media

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Vista, F9+LUKS, 3 HDDs
    By Korexio in forum Installation, Upgrades and Live Media
    Replies: 6
    Last Post: 23rd June 2008, 06:44 PM
  2. FC6 not recognizing HDDs
    By chandlerbling in forum EOL (End Of Life) Versions
    Replies: 6
    Last Post: 6th February 2007, 11:15 AM
  3. Combining two HDDs into one
    By cypher543 in forum Installation, Upgrades and Live Media
    Replies: 2
    Last Post: 21st July 2006, 04:23 PM
  4. Western Digital HDDs
    By MrWh1t3 in forum Installation, Upgrades and Live Media
    Replies: 4
    Last Post: 26th May 2004, 01:51 AM

Posting Permissions

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