linux挂载ext3分区硬盘,ArchLinux中hal挂载ext3分区格式的移动硬盘

ArchLinux中hal挂载ext3分区格式的移动硬盘

发布时间:2008-04-09 13:19:24来源:红联作者:yashu

最近将移动硬盘格成了ext3格式,插上后,hal能将这个移动硬盘自动挂载,但是问题在于挂载点的权限变成了root:root, 755。这样,普通用户我使用的eric用户就无法写这个目录了。

一开始认为又要去编写那些麻烦的hal policy了,但是始终有个疑问就是,我的U盘插上后,权限也是755,但是owner是eric,所以,U盘通过HAL自动挂载后,eric是可以写入的,一点问题没有。当然,这一点得益于之前hal的配置,而且配置了eric用户属于storage, optical...这些组。

为什么移动硬盘插上就不行呢?owner就是root呢?在经过一番研究后,发现不是HAL policy的问题,问题在于:ext3作为linux的分区格式,是privilege/permission aware的。也就是说,当初格式化移动硬盘的时候,是用root用户操作的,完成后分区的根目录和所有子目录的权限就是755, root:root。

了解到了这一点,我就开始修改权限和owner了。首先卸载移动硬盘,切成root用户手动mount到/media/newman目录(newman目录事先建好),然后:

chown -R eric:users /media/newman

完成后,umount,再接上,使用HAL自动挂载,一切就OK了!/media/disk的owner就是eric:users了!(/media/disk是HAL设置的挂载点,该目录自动创建,硬盘卸载后该目录自动删除)

总结:ext3本身就有权限、owner这些东西(这是和windows的fat32, ntfs不一样的,所以,这些文件系统就需要我们通过hal policy来手动给dir和file设置权限),所以,不需要设置policy。HAL会自动将设备挂载成他原来的权限。

BTW:上述的chown命令修改的是移动硬盘的权限,而不是本地硬盘上这个目录的权限,简言之,对硬盘挂载点目录的操作都是针对移动硬盘的。将移动硬盘卸载后,该挂载点原来目录(上面例子中就是/media/newman目录)的权限就会恢复。

可以读写Ext2,以Ext2方式挂载Ext3文件系统(不支持Ext3日志),不支持文! It provides Windows NT4.0/2000/XP/2003/Vista/2008 with full access to Linux Ext2 volumes (read access andwrite access). This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer. What features are supported? Complete reading and writing access to files and directories of volumes with theExt2 orExt3 file system. Supports features which are specific to the I/O-system of Windows: Byte Range Locks, Directory Notfication (so the Explorer updates the view of a directory on changes within that directory), Oplocks (so SMB clients are able to cache the content of files). Allows Windows to run with paging files on Ext2 volumes. UTF-8 encoded file names are supported. The driver treats files with file names that start with a dot "." character ashidden. Supports GPT disks if the Windows version used also does. Supports use of the Windows mountvol utility to create or delete drive letters for Ext2 volumes (except on Windows NT 4.0). See also section"Can drive letters also be configured from scripts?". What features are *not* supported? Inodes that are larger than 128 bytes are not supported. Access rights are not maintained. All users can access all the directories and files of an Ext2 volume. If a new file or directory is created, it inherits all the permissions, the GID and the UID from the directory where it has been created. There is one exception to this rule: a file (but not a directory) the driver has created always has cleared "x" permissions, it inherits the "r" and the "w" permissions only. See also section"What limitations arise from not maintaining access rights?". The driver does not allow accessing special files at Ext2 volumes, the access will be always denied. (Special files are sockets, soft links, block devices, character devices and pipes.) Alternate 8.3-DOS names are not supported (just because there is no place to store them in an Ext2 file system). This can prevent legacy DOS applications, executed by the NTVDM of Windows, from accessing some files or directories. Currently the driver does not implement defragging support. So defragmentation applications will neither show fragmentation information nor defragment any Ext2 volume. This software does not achieve booting a Windows operating system from an Ext2 volume. LVM volumes are not supported, so it is not possible to access them.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值