Find the answer to your Linux question:
Results 1 to 5 of 5
Hello everybody, I've been googling for many days, and found no answer (even nothing similar) to my question / problem, so let me ask you for some enlightment about it. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    3

    use of ext3 in an external usbdrive


    Hello everybody,

    I've been googling for many days, and found no answer (even nothing similar) to my question / problem, so let me ask you for some enlightment about it. I think it is a quite reasonable one to come up, and I am really surprised that I couldn't find any previous information about it.

    If you just want to read the question I am posing you can just go straightforward to the last paragraphs. The preceding ones are just a little background / history that may also bring up some interesting comments, I hope.

    During the last days I bought two nice lacie external usb HDD (160 GB and 500 GB), each of them preformatted with an only fat32 partition.

    I've been a Debian user/root for almost three/two years. All my boxes run either Etch or Lenny, and there I spend ~98% of my (computer) time. However, some of them have dual boot with various Win versions, with their corresponding small fat16 / fat32 / ntfs partitions, since I can't get to do some very few relevant things with my so-loved Debian systems, namely 1) fill my fellowship forms without messing all the format, 2) use skype with video, and 3) get my still-Win-user parents to pay me the hardware.

    So I don't want all that fat32 gigs, with all the file permissions getting crazy every time I get anything from there, the ridiculous file max size, the ms partial patent, etc..

    I began playing aroud with the 160 GB drive. Thanks to gparted I managed to resize the fat32 partition to just 40 GB, and created three 40 GB ext3 partitions. Then I added the following lines to my /etc/fstab
    Code:
    # <file system>   <mount point>       <type>        <options>            <dump>    <pass>
    #usb-disk
    /dev/sdb1         /mnt/lacie1_fat32   vfat,ext3  rw,user,noauto,utf8      0        0
    /dev/sdb2         /mnt/lacie2           ext3          rw,user,noauto      0        0
    /dev/sdb3         /mnt/lacie3           ext3          rw,user,noauto      0        0
    /dev/sdb4         /mnt/lacie4           ext3          rw,user,noauto      0        0
    and creted the corresponding four /mnt subfolders (all of them root:root owned with 755 permissions).

    I first tested the fat32 partition, and everything worked as expected from my usb flash memory experience: I was able to mount the partition as a simple user, then /mnt/lacie1_fat32 got myuser:myuser ownership, and I could rwx there; and as soon as I umounted it, the /mnt/lacie1_fat32 folder recovered its root:root condition.

    Yes, you guessed, then I went into the second (ext3) partition and got some problems. I could mount /mnt/lacie2 as a simple user, and see its corresponding lost+found subfolder, but then its (/mnt/lacie2) ownership and permissions stayed as root:root and 755, so I couldn't write anything into it.

    Since I was at the university, it was late, and just wanted to backup some files, I did the first thing that came up to my mind:
    Code:
    #chown myuser:myuser /mnt/lacie2
    copied the files and umounted. Since the folder got its root:root ownership back then, I thought: "hey, you just set the ownership of the second partition of the drive". That was true: I mounted it back as myuser, and got my ownership. Cool.

    Not that cool. What if the computer doesn't have your myuser defined? Since my user at the department network is different from my home user, I could experimentally observe it: when I mounted the partition at home, I got a nice 1236 ownership, which is my user number at the department, and it is obviously not home-defined. And not only the folder, all its files were (logically) owned by a system-undefined user.

    To access the files, I did a
    Code:
    #chown -R myhomeuser:myhomeuser /mnt/lacie2
    and that was it.

    But, before even touching the 500 HD, and since I am leaving for some months to another city where I may not get to be the root of all the computers I use, let me ask you: is there any other simpler (I would just say "any correct") way of using ext3 (or any other kind of nice Linux filesystems) in such a plug-in-many-computers drive, without having to run half the commands as root?

    What I really want is to be able to mount, umount, and rwx a good free-filesystem partition as any user in any machine, in a way that the mounting user gets ownership of all the files that were owned by the last user that mounted/umounted the partition. I think this user mappings could be possible, but have no clue about what group ownership would have sense in this context.

    Thank you for your time. I am really looking forward to reading your advices / points of view .

  2. #2
    Just Joined!
    Join Date
    Jul 2007
    Posts
    75
    nice but what will happend when you gotta copy some stuff to a friend that got windows ?

  3. #3
    Linux Newbie mazer's Avatar
    Join Date
    Jul 2006
    Location
    Tucson, Arizona, USA
    Posts
    109
    Hi ripero,

    I do not mount my usb devices manually through fstab. For fedora core, there is a daemon that automatically mounts these devices (hal daemon). I guess this daemon is also available for your distributions. My experience is that hal is assigning the correct user and group so that you can write on your device after you have plugged it into your usb slot.

    Mazer

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Aug 2007
    Posts
    3
    Quote Originally Posted by Juukamen View Post
    nice but what will happend when you gotta copy some stuff to a friend that got windows ?
    Well, I see your point, but
    a) most of my friends use linux,
    b) it's another reason for the ones that are non-linux users to swtich to linux, and
    c) if needed it is still possible to transfer the files to a windows system with a little extra effort (via another partition, etc.)

    It's much easier than having to change the permissions of all the files every time you mount the device!!

  6. #5
    Just Joined!
    Join Date
    Aug 2007
    Posts
    3
    Quote Originally Posted by mazer View Post
    Hi ripero,

    I do not mount my usb devices manually through fstab. For fedora core, there is a daemon that automatically mounts these devices (hal daemon). I guess this daemon is also available for your distributions. My experience is that hal is assigning the correct user and group so that you can write on your device after you have plugged it into your usb slot.

    Mazer
    Thank you, I'll have a look at it. However, the "daemon that automatically mounts these devices" looks dangerous - although now that I think better about it, maybe not as dangerous as what yesterday I thought I wanted to do.

Posting Permissions

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