Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yesterday I installed Linux for the first time, dual-booting with XP which I already had. I wanted the home partition to be shared between XP and Linux, but I set the filesystem to ntfs so Linux couldn't use it and I had to tell it to put /home on the root partition, to proceed with the install. Now I want to reformat that unused partition to FAT32 so both OSs can use it, but how do I set this as the new /home partition? There's already a /home directory; would its contents be moved to the new partition automatically?
I am a Linux newbie so I apologize for the basicness of this question.
The given link appears to supply the pertinent information, but I would like to give you some words of caution.
Making your /home viewable across OS's is an extremely bad idea, IMHO, for the following reasons.
1) Windows, especially, loves to clutter directories with "hidden" meta-data (read: Thumbs.db and the like will be annoyingly visible in every directory when you are in Linux).
2) If either OS thinks there is a problem with the partition it may try to fix the problem, screwing up both operating systems and destroying your precious data (I speak of this from experience with this exact scenario).
3) FAT32 is a particularly bad filesystem. This is why NTFS was created - it is, to a degree, better, and is why Microsoft always used it in their server products after it was created. I have found that using FAT as a primary filesystem is a quick route to lose valued data. Linux should use ext3, Windows should use NTFS.
So, here are my suggestions.
The best solution is to have two separate machines networked with shares across the network. This results in the desired cross-platform data availability while dramatically reducing the possibility of something horrible happening. I also generally dislike dual-booting period - I have seen operating systems try to "fix" the "broken" partition table more than once, rendering one or both OS's unbootable.
A lesser solution is to create a separate FAT32 filesystem to act as a buffer. COPY shared data there (perhaps use a script to do this at shutdown) to avoid damage to all of /home, or to the original data.
Thanks for the replies, both of you. The first link looks like exactly what I need to know, but shultz gives good points for not using it. I'm on a laptop and it's my only computer (though I do have an external USB hard drive, but I don't take it everywhere I take the laptop) but I like the idea about creating a buffer partition. I have 26GB free so I figure I'll make a 15GB reiserjfs /home, 1GB FAT32 /winux (the windows-linux swap), and a 10GB ntfs Windows data directory.
Since I already have three partitions (Windows, root, swap), I create one extended partition and divide it into three subpartitions, right?
I applaud you for choosing to try the buffer partition route.
The extended partition route is the way to go. You can do this with fdisk, but if you happen to have Partition Magic on your Windows side, use it - there is nothing that comes close as far as I know in terms of versatility and ease of use.
BTW, if you didn't know it there is a kernel module available that allows you to mount NTFS read-only. See linux-ntfs.sourceforge.net.
There is also a neat little tool called explore2fs which allows you to read ext2/3 partitions from Windows (again, read-only) (see http://uranus.it.swin.edu.au/~jn/linux/explore2fs.htm). I don't know about reading Reiser.
Between these tools you can, with effort, effectively work from both sides of the machine.
/dev/hda5: 1GB FAT32, I intend both Linux and Windows to read and write to this
/dev/hda6: 10GB Linux (I want to move /home to this, I already ran "mkreiserfs /dev/hda6")
/dev/hda7: 11GB NTFS (Windows only, I don't really care about this at the moment)
Anyway this is a really basic question, but how can I access these partitions? I tried searching but nothing relevant came up. I assumed, for example, "cd /dev/hda6" would work but it does not.
If you have made the filesystems (which you evidently did with mkreiserfs) then you must mount the partitions at mount points of your choice.
For the FAT32, su to root and make a directory like /mnt/buffer or, as you suggested above, /winux (though I shy away from creating mount points in / as a matter of organization). Then as root do a "mount /dev/hda5 /winux" or the like to mount the partition. You can then do a "cd /winux" to access the volume.
For non-root users to be able to mount the partition and/or write to it you will need to make some permissions changes. To have it mount automatically, you will need to edit /etc/fstab as appropriate. Read the manfile on fstab and if you still have questions let me know.
For /home, create a temporary mountpoint, mount /dev/hda6 there, then copy ("cp -a" to enable archive mode [preserves permissions, etc... see "man cp"]) the contents of the existing /home to the temporarily mounted partition. Then edit /etc/fstab to point /home at /dev/hda6, change permissions as necessary, and you're done. If this is too much to digest, let me know.
Thanks for yet another reply, shultz. I created the reiserfs system for /dev/hda6, and I did what you said about mounting it and copying the /home files; there were no problems there. However I don't know what I put in the fstab file. Does the line begin:
/dev/hda6 /mnt/home reiserfs [options]
or:
/dev/hda6 /home reiserfs [options]
/mnt/home is the temporary home, which I mounted /dev/hda6 to already. Also, what options should I use?
The same question goes to /dev/hda5 -> /mnt/winux. I just used Windows XP to format the partition to FAT32, then I went into Linux, mounted the partition with "mount -t vfat /dev/hda5 /mnt/winux", and saved a file into it. I then went back into Windows and there was my file! So I'm happy that worked. But I haven't added anything to fstab yet.
Last edited by CGameProgrammer; 10-12-2004 at 03:57 AM.
Following is a line from my /etc/fstab for my /home directory (in my case an ext3):
/dev/hda3 /home ext3 defaults 0 0
The latter option you presented is what you want, with the options denoted as in my example line above. What this will do is tell linux that if you run "mount /home" that it should mount /dev/hda6 there. You will then (as root, and while you are not browsing in /home) run "umount /mnt/home", then "umount /home", followed by "mount /home". This will now have the new partition mounted there as desired. Run "df" to verify - this will merely print a list of mounted partitions, mountpoints, and volume sizes. Once you have verified that it works, you can run "umount /home" again, delete the old files in the original /home, and remount /home. From then on, /home will mount automatically at boot and, since the user directories are already there, no permission mods will be needed. Make sense?
(BTW, you can at this point then delete the temporary mountpoint to unclutter things.)
For creating the vfat filesystem look for a program, probably in /sbin, called mkfs.vfat. (It may be educational to do "ls /sbin/mkfs*" to see all the types of filesystems you can make. Also, "cat /proc/filesystems" will show you what filesystems your kernel supports, which can be handy if you ever get a "must specify filesystem type" error.)
There's just one thing that puzzles me... the swap partition isn't listed anywhere. Seems odd. /hda1 is Windows XP so naturally it doesn't appear, and /hda2 is the root, but /hda3 is swap, it should be in the list, shouldn't it? Oh, I just realized I have no swap directory. That can't be right. This line is in fstab:
Quote:
/dev/hda3 swap swap defaults 0 0
But there is no /swap. Should I "mkdir swap" and mount it myself? edit: I'll assume so, since "find / -name swap" turned up zilch. edit again: Ah, when I run "mount /swap" after making the directory, it gives me an error that filesystem type "swap" isn't supported by my kernel. The fstab file has an error in it, that's why it didn't create it. Haha. Well I tried changing the type to "linux-swap" but it didn't like that either. Any ideas?
Last edited by CGameProgrammer; 10-12-2004 at 07:07 AM.
Also, I have another problem... I can't access /winux as a regular user. As root, I tried running "chgrp users /winux" but it said it couldn't change its group, and chmod had no effect either. Right now winux's group and owner are both 'root' and the permissions are 744 (group and other can only 'read' it, which isn't really true since neither can open the directory).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.