[opensuse] mount command ignoring options?
Hello, I am trying to build a system running from a flash drive, while keeping the flash drive in regular use too. So I have created an ISO image using SuseStudio and placed it on a flash drive using live-fat-stick (which is a script wrapping syslinux). It's working fine, but now I want to mount the flash drive itself, to use for persistent storage. It mounts just fine, but all files are set to root as owner, and writeable only by root. I try to use mount options but they are roundly ignored, for example: # unount /vol/flash # mount -t vfat -o uid=1000,umask=0000,dmask=0000,fmask=0000 /dev/disk/by-label/MIKFL32 /vol/flash # cat /etc/mtab (loads of stuff here) /dev/sdb1 /vol/flash vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0 And ls -l /vol/flash lists the files as owner by root with rwxr-x-r-x permissions. Moreover, even the command (run as root, of course) "chmod -R 777 /vol/flash" does not change anything. "chmod -R myuser /vol/flash" gives loads of "operation not permitted" errors. How can I make it mount the file system with either umask=0 (so r/w/x permissions for everyone), or else owned by the user with the UID of 1000? I can not use /etc/fstab apparently, as it seems to be created dynamically by the SuseStudio-created system. But that's fine, I don't need it that early anyway. I can run the mount command from the stratup script or even froma script I run manually later. The important part is to get the command to work right. Lots of gogling did not clarify the issue. I tried to add the "user" option but it would not work anyway. -- Yours, Mikhail Ramendik Unless explicitly stated, all opinions in my mail are my own and do not reflect the views of any organization -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 12 January 2015 at 19:27, Mikhail Ramendik
It's working fine, but now I want to mount the flash drive itself, to use for persistent storage. It mounts just fine, but all files are set to root as owner, and writeable only by root.
I have found the answer, placing it here for the benefit of anyone doing a search later. The device is already mounted as /isofrom and is busy, so can not be remounted. Looks like I have to modify the initrd, or else use a file with a loopback ext2 file system for persistence. -- Yours, Mikhail Ramendik Unless explicitly stated, all opinions in my mail are my own and do not reflect the views of any organization -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 13/01/2015 03:56, Mikhail Ramendik a écrit :
On 12 January 2015 at 19:27, Mikhail Ramendik
wrote: It's working fine, but now I want to mount the flash drive itself, to use for persistent storage. It mounts just fine, but all files are set to root as owner, and writeable only by root.
I have found the answer, placing it here for the benefit of anyone doing a search later.
The device is already mounted as /isofrom and is busy, so can not be remounted.
Looks like I have to modify the initrd, or else use a file with a loopback ext2 file system for persistence.
can't you mount --bind it? jdd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 13 January 2015 at 07:50, jdd
The device is already mounted as /isofrom and is busy, so can not be remounted.
Looks like I have to modify the initrd, or else use a file with a loopback ext2 file system for persistence.
can't you mount --bind it?
# mount --bind /isofrom /mnt # mount -o remount. uid=1000 /mnt files in /mnt are still owned by root. No luck. -- Yours, Mikhail Ramendik Unless explicitly stated, all opinions in my mail are my own and do not reflect the views of any organization -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 13 January 2015 at 13:10, Mikhail Ramendik
# mount --bind /isofrom /mnt # mount -o remount. uid=1000 /mnt
that was a typo in writing to the list; it was mount -o remount,uid=1000 /mnt on the actual system. No luck so. -- Yours, Mikhail Ramendik Unless explicitly stated, all opinions in my mail are my own and do not reflect the views of any organization -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, 13 Jan 2015 14:10, Mikhail Ramendik
On 13 January 2015 at 07:50, jdd
wrote: The device is already mounted as /isofrom and is busy, so can not be remounted.
Looks like I have to modify the initrd, or else use a file with a loopback ext2 file system for persistence.
can't you mount --bind it?
# mount --bind /isofrom /mnt # mount -o remount. uid=1000 /mnt
files in /mnt are still owned by root. No luck.
Just a hint, could be wrong about it: If /etc/mtab is a sym-link pointing to /proc/mounts some information is lost, and some options will fail, particular using the "user" option will fail. see "man 8 mount" section: "The /etc/fstab, /etc/mtab and /proc/mounts files" OTOH the options for remount should be "-o remount,uid=1000" no dot, no space. In your case, also check what keeps /isofrom busy (lsof is your friend) - Yamaban. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2015-01-13 15:06, Yamaban wrote:
In your case, also check what keeps /isofrom busy (lsof is your friend)
He has placed a bootable iso image into a FAT stick, as file, not dd, and that is what is running. Then he has read/write access to that same FAT filesystem. But it is owned by root and he wants access by plain user. As it is FAT, directories can not be chowned. And as it is mounted, because the booting and running live is inside, it can not be umounted and mounted again as user. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 13 January 2015 at 14:18, Carlos E. R.
In your case, also check what keeps /isofrom busy (lsof is your friend)
He has placed a bootable iso image into a FAT stick, as file, not dd, and that is what is running. Then he has read/write access to that same FAT filesystem. But it is owned by root and he wants access by plain user.
As it is FAT, directories can not be chowned. And as it is mounted, because the booting and running live is inside, it can not be umounted and mounted again as user.
Yeah, sums things up nicely. So looks like I have four options: - LD_PRELOAD and pass requests for that filesystem to a root-owned process. Way too much coding. - Change the initrd image that actually mounts the file system and reads the ISO. Downside: I have to redo the changes each time I roll a new version of the ISO, as the initrd is extracted from the ISO by live-fat-stick. (Or just use the older initrd for newer versions of the iso, given that I don't actually change kernel-related configuration?) - Repartition the flash drive and install Linux on one partition while using VFAT on the other for general use (with Windows PCs). No longer do ISO. Either do a raw image in susestudio, or forgo opensuse and use debootstrap (I have a Debian workstation). - Forgo plain user access to the FAT32 file system. Instead, create a file on that system and use that as persistent storage witn an ext2 file system in it. When I want to exchange files with Windows systems, just use the root user to copy them to the FAT32 file system I am thinking of taking the last option. It will also allow me to mount the file as /home and, hopefully, to encrypt it (I am going to try including dm-crypt in the ISO). -- Yours, Mikhail Ramendik Unless explicitly stated, all opinions in my mail are my own and do not reflect the views of any organization -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2015-01-13 15:30, Mikhail Ramendik wrote:
On 13 January 2015 at 14:18, Carlos E. R. <> wrote:
...
Yeah, sums things up nicely.
...
- Repartition the flash drive and install Linux on one partition while using VFAT on the other for general use (with Windows PCs). No longer do ISO. Either do a raw image in susestudio, or forgo opensuse and use debootstrap (I have a Debian workstation).
There is a (small?) caveat. Flash sticks are actually optimized for FAT, meaning that they are prepared for a higher number of writes in the initial area of the stick, where the FAT is, than in the rest of it, the data area. By placing two partition the second one is beyond that area; thus the boot area should be the second partition. This also affects formatting in any other filesystem types, of course. And I have no data on exactly how they do this customization; I read a report on this some years ago, so I know it is true.
- Forgo plain user access to the FAT32 file system. Instead, create a file on that system and use that as persistent storage witn an ext2 file system in it. When I want to exchange files with Windows systems, just use the root user to copy them to the FAT32 file system
Well, the openSUSE lives, and probably the susestudio lives, I don't know, create on the first boot a persistent writeable partition on the rest of the stick, using ext4, I think. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)
On 01/13/2015 03:30 PM, Mikhail Ramendik wrote:
So looks like I have four options:
one more: the upstream project util-linux is quite active, and IIRC there was a change going that direction a few months ago. Look there. Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 13/01/2015 15:30, Mikhail Ramendik a écrit :
- Repartition the flash drive and install Linux on one partition while using VFAT on the other for general use
AFAIK, it's what the lave dvd do, creating an other writable partition
- Forgo plain user access to the FAT32 file system. Instead, create a file on that system and use that as persistent storage witn an ext2
don't forget fat files have limited size why do only two partitions? mùake as much as needed, with just one for fat jdd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 13 January 2015 at 15:47, jdd
- Forgo plain user access to the FAT32 file system. Instead, create a file on that system and use that as persistent storage witn an ext2
don't forget fat files have limited size
4G is way enough, in fact 512M is probably enough. I don't plan to do very much with that appliance. Now I just need to get my head around dw-crypt - the big question is how to make it ask for the passphrase at startup, before it gets to X or logging in. -- Yours, Mikhail Ramendik Unless explicitly stated, all opinions in my mail are my own and do not reflect the views of any organization -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Bernhard Voelker
-
Carlos E. R.
-
jdd
-
Mikhail Ramendik
-
Yamaban