#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    317
    Rep Power
    0

    How to treat a external hdd when using it on two diff notebooks [name-conventions]


    i have two notebooks and a new external hdd.

    this is a thread that wants to make clear how to treat a external hdd when using it on two diff notebooks, Are there any issue i can be faced - eg. can there be any conflicts with naming-conventions


    what is aimed: well i want to collect and backup the data from the both notebooks. how to do that:

    well i do like that:

    i create a directory

    Code:
    # mkdir /mnt/external
    and mount this with
    Code:
    mount /dev/sdb1 /mnt/external

    then i do that:


    Code:
    chomd -R 0777 /mnt/external
    and then i mount again with

    Code:
    mount /dev/sdb1 /mnt/external
    question. can i do this procedure with the both machines - can i do it with exactly the same commands, names - or is it not corrrect to name the directories on the external drive with exactly the same name!!?

    Well - for me as a beginnner in the filed of mounting drives - it is a important question: i do not want to cause conflicts


    if i have to explain the ideas and thoughts more thouroghly - just let me know.

    love to hear from you





    ps see some results - that i got when trying to name (/treat) the external drive exacly the same way ... when it is connected to the second notebook

    see seome reports and steps i take - as trying to mount the external drive on the second notebook


    Code:
    Passwort:
    linux-70ce:/home/martin #
    linux-70ce:/home/martin #         mkdir -p /mnt/external
    linux-70ce:/home/martin # mount /dev/sdb1 /mnt/external
    linux-70ce:/home/martin # chomd -R 0777 /mnt/external
    If 'chomd' is not a typo you can use command-not-found to lookup the package that contains it, like this:
        cnf chomd
    linux-70ce:/home/martin # chomd -R 0777 /mnt/external
    If 'chomd' is not a typo you can use command-not-found to lookup the package that contains it, like this:
        cnf chomd
    linux-70ce:/home/martin # umount /dev/sdb1
    linux-70ce:/home/martin #
    linux-70ce:/home/martin # chomd -R 0777 /mnt/external
    If 'chomd' is not a typo you can use command-not-found to lookup the package that contains it, like this:
        cnf chomd
    linux-70ce:/home/martin # chown martin:users /mnt/external
    linux-70ce:/home/martin # mount /dev/sdb1 /mnt/external
    linux-70ce:/home/martin #
    linux-70ce:/home/martin # mount  /mnt/external
    mount: /dev/sdb1 is already mounted or /mnt/external busy
           /dev/sdb1 is already mounted on /run/media/martin/HDDRIVE2GO
           /dev/sdb1 is already mounted on /var/run/media/martin/HDDRIVE2GO
           /dev/sdb1 is already mounted on /mnt/external
    linux-70ce:/home/martin #
    hmmm - it is a bit strange isnt it
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,449
    Rep Power
    1751
    Ok, first off the command you are after is chmod, not chomd!

    Next, the owner and group of the files and directories are based on the uid and gid involved - whether from when created or from modification via a chown or chgrp command.

    If you mount the disk at /mnt/external on one machine and create a file (after doing a cd /mnt/external using, for example, touch dummy.txt) and then do a long list of it (ls -l dummy.txt) you will see the owner is your user (looks like that'd be martin from your examples) and the group would be ... well, something else! What that actually means is the system has looked up the uid and gid of the owner and group in the /etc/passwd and /etc/group files and shown the clear text version for your convenience.

    The permissions are associated with the owner, the group and others - NOT with the specific user.

    Now, unmount the drive and mount it on another machine (say at /mnt/second_ext) and after a suitable change directory do an ls -l dummy.txt. The owner and group shown will be either text or a number. If they are shown as text then you have a user and/or group with a matching uid/gid on this machine. If either shows as a number then you are seeing the base uid or gid as the system cannot find a match. You may have a user also called martin on this second machine but unless it has the same uid as on the first machine that user will not be the owner.

    You will note the permissions are the same, regardless of who the system tells you is the user of the file.

    In essence if you wish to use this HDD on the two machines with the minimum of hassle then ensure that the users you use have the same uid (assuming they are 'the same').
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo