New Linux user, need help with a second hard drive
First of all I would like to say Hi to everyone here!
Okies, my problem. I am currently running a IBM X40, dual booting winxp and suse9.1. I have one bay in the dock and I switch a dvd-cdr combo drive in and out with a 80 gig hard drive. Before I installed Linux, I killed the NTFS partition on the drive and left it unpartitioned. When I booted up linux, it found the drive, and I partitioned it Fat32. Now to my problem: The permissions are all screwed up. I have tried everything I can think of. The obvious stuff: Logged in as root and changed all the permissions (they didn't save) | Changed the Owner (didn't save) | Had a friend who knows linux chmod 777 . (i believe was the command) it. I also repartitioned it and made sure I didn't have any strange partition rules in it then. I could really use a link to a toutorial (I checked this site, and google) or a step by step to get it running. Thanks in advance, and thanks for your time. Lifix. |
You should read through the manual pages on fstab and mount.
Open a terminal and type "man fstab" and "man mount". You copuld also look at "man hd". As with all linux be careful when you make changes to /etc/fstab, you could mess up the existing set up I am a bit surprised Susie does not have a utility to install a new hd? |
I think his problem is with permissions and not with mounting/partitioning. He's asking about how to get his file security to work properly.
|
FAT/VFAT/FAT32 (and FAT32X and so on...) does not support UNIX-style permissions such as the ones we use on the common Linux filesystems. To circumvent this you can mount the FAT partition with special options to indicate what permissions should be given to all files and directories on the drive.
Let's do this Linux style. :) First we add a group to which we then will add users that should be able to read (and optionally write) to the Windows partition. I call this group "winread" but you can call it whatever you want. As root (type su to become root, and type exit when done to become your old boring self again) type the following to add a group called "winread": groupadd winread Very painless, don't you think? :) Now open up the file /etc/group (still as root) with a text editor. At the bottom of the file you should see your newly created group, something like this: Code:
windisk:x:408: Code:
windisk:x:408:hw,lifix Now we will change the way we mount our Windows partitions. Open up the file /etc/fstab in a text editor, but make a backup copy first! I keep files like this one in /root/backups/conffiles/ so I know I can roll back if I mess up (and with these files you really can mess up!). Find the line referring to your FAT32 partition that you want to have write access to. Linux calls FAT32 "vfat", so that's what you should be looking for. I assume you can find it since you're talking about weird permissions on it, and it wouldn't be mounted automatically if it wasn't in this file. Here's the one I want to mount nicely: Code:
/dev/hda1 /mnt/win_e vfat defaults 0 0 Anyway, we want better permission, right? I will only touch the options part here since I feel the others are OK. Instead of defaults we add this: Code:
noatime,user,gid=408,umask=007 So, now our fstab line looks like this: Code:
/dev/hda1 /mnt/win_e vfat noatime,user,gid=408,umask=007 0 0 I realize this is all kind of long winded and may appear a bit tricky but once you get used to group permissions it's very very usable and an effective way of granting or restricting access to services, files and so on. Håkan |
Okies, before I go in and do all of that, the hard drive will be linux only, so how should I format it to get the permissions to work? Its not a drive I will want to access with windows.
|
Oh, since you formatted it as FAT32 originally I thought you would. Setting up a Linux disk in Linux is pretty straightforward:
1. Partition the disk. Type fdisk /dev/hdd (replace /dev/hdd with the actual device name). You will see a simplistic prompt. Press P to view the partitions or H to get help, W is the only option that actually writes the partition table to the disk so you can quit anytime using Q. Press N for new partition, number 1, set up size and so on...Type should be 83/Linux. 2. Choose your filesystem. I prefer journalling filesystems, ext3fs and reiserfs are the most common choices. To create an ext3 partition type mke2fs -j /dev/hdd (again, /dev/hdd is only an example), to use reiserfs type mkreiserfs /dev/hdd. 3. Create a mountpoint. This is the directory where you will access the contents of the partition. For storage I prefer /usr/local/storage or /mnt/storage but you can use whatever you like. 4. Set up /etc/fstab so the partition is mounted automatically. A simple example: Code:
/dev/hdd1 /mnt/storage reiserfs noatime 0 0 Håkan |
All times are GMT -5. The time now is 03:52 AM. |