| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
|
By mcd at 2003-09-01 01:55
|
|
This is to help create a functioning FAT32 (vfat) partition to be shared between your linux and windows OS's. For simplicity, i'll assume that you're using hda1 for windows, hda2 as an extended partition for linux with hda5,6 and 7 for /, /usr, and swap contained as logical sub-partitions. That's a normal setup. Now you'll want to create a new partition using fdisk. Some people seem to be afraid of this, but i find it very easy to use. First, go to the command line and as root type:
telinit s
this will take you to single user mode, which means disks aren't usually mounted and stuff like that (it's not a good idea to try and format a disk that's already mounted and in use). type:
fdisk hda
this will take you into the menu-driven fdisk program. type:
p
to list your current partitions, and take a moment to familiarize yourself with the setup. an i.d. of 83 is an ext3 linux native partition, i.d. 82 means a linux swap partition.
Now you want to create a new primary partition, with a file system type FAT32 (this can be easily accessed by both OS's) to do this, type:
n <---- create new partition
p <---- primary
3 <---- label it hda3 (3rd primary)
At this point it'll ask for first and last sector, which will default to first available sector and last available sector (take up any free space left), if you want to control the size yourself, say create a 5 gigabyte partition, accept the first default, then type +5000M
Now change the fs type with
t
c <---- this specifies vfat filesystem
and review what you've done with 'p' to make sure everything is the way you want it. If you're satisfied, use 'w' to write the partition table to disk, and exit fdisk. (WARNING: this will write the partition table to disk, make sure you haven't changed any of your old partitions)
At this point you need to format the new parition, which can be done with mkfs, although i had to download dosfsutils because slackware didn't come with mkfs.vfat (FAT32) included. If you are missing this package, try the following link to download the rpm (i'm still looking for a good source package).
http://rpmfind.net/linux/RPM/ultrapenguin/1.1.9/sparc/RedHat/RPMS/mkdosf...
Either way, in the end the command should look something like this:
mkfs -t vfat /dev/hda3
OR
mkfs.vfat /dev/hda3
Assuming that works, there's just one thing left to do: edit your /etc/fstab to automatically mount the new partition on boot. Use emacs, vi or whatever editor you're familiar with, and add the following line:
/dev/hda3 /mnt/windows defaults,umask=000 0 0
There are actually several different sets of options you could use in place of defaults, but i have this setup and it so far it works extremely well for me. Type:
mount -a or mount /dev/hda3
and presto!, you should be able to read and write to this partion from linux or windows!
Well, there you go. I apologize if that's more detail than you wanted, but it's best to have the info and not need it, than the other way around.
If anything goes wrong, or you have questions, post up.
|
|
|
|
All times are GMT -5. The time now is 02:45 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|
- The UNIX permissions of a directory onto which you mount a Windows filesystem can't be changed while the fileystem is mounted (the chang might appear to work, but it won't persist). If you need to change the UNIX permissions of the mount point, unmount the Windows filesystem before doing so.
- Windows doesn't support UNIX-style permissions, so you can only apply permissions to the entire Win filesystem, not to individual files/folders. The default permission mask applied to FAT32 volume at mount time are rwx for root, but only rx for normal users; this is modified with the "umask" option of the mount command.
- The value of the permission bits used with umask are the opposite of those used with the chmod command. For example, the following pairs are equivalent:
umask=000 and chmod 777
umask=022 and chmod 755
Remember, this post is not for asking for help, just for commenting the article at the beginning of the post.
Simply read this article, it will answer most of your questions.
If not, here is how you could make the thing work :
Just type fdisk in order to try to guess how your partitions are named from a Linux point of view.
Then add the mount points in /etc/fstab with the correct syntax.
Here is my fstab, have a look :
/dev/hda5 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda7 /home ext3 defaults 1 2
none /mnt/cdrom supermount dev=/dev/hdc,fs=udf:iso9660,ro,--,iocharset=iso8859-15 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,iocharset=iso8859-15,sync,umask=0,codepage=850 0 0
/dev/hda1 /mnt/win_c vfat iocharset=iso8859-15,umask=0,codepage=850 0 0
/dev/hda2 /mnt/win_d vfat iocharset=iso8859-15,umask=0,codepage=850 0 0
/dev/hda3 /mnt/win_e vfat iocharset=iso8859-15,umask=0,codepage=850 0 0
none /proc proc defaults 0 0
/dev/hda6 swap swap defaults 0 0
/mnt/win_c is my Windows C: disk
/mnt/win_d is my Windows D: disk
/mnt/win_e is my Windows 200 E: disk.
this was created automatically before the partitions existed before I install Linux, but I was also successful (on another system) adding filesystems created after Linux installation.
Homp this helps.
@Forezt, with my umask=0 parameter I use these filesystems as normal user, not as root.
So here is what i did:
[root@electrolinux root]# fdisk /dev/hda
The number of cylinders for this disk is set to 1216.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/hda: 10.0 GB, 10005037056 bytes
255 heads, 63 sectors/track, 1216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 522 4192933+ b Win95 FAT32
/dev/hda2 523 535 104422+ 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (536-1216, default 536):
Using default value 536
Last cylinder or +size or +sizeM or +sizeK (536-1216, default 1216):
Using default value 1216
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): c
Changed system type of partition 3 to c (Win95 FAT32 (LBA))
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
[root@electrolinux root]# mkdosfs -F 32 /dev/hda3
mkdosfs 2.8 (28 Feb 2001)
You have new mail in /var/spool/mail/root
[root@electrolinux root]#
THEN: I edited my /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hdb3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/hda3 /mnt/win vfat defaults,umask=000 0 0
THEN:
[root@electrolinux root]# mount /dev/hda3
mount: mount point /mnt/win does not exist
So here is my problem...it keeps saying it doesn't exist....what do I do?
TIA.
Simply type mkdir /mnt/win
followed by mount /dev/hda3