LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-09-2004, 06:30 PM   #1
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Rep: Reputation: 15
Creating a home partition


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.
 
Old 10-09-2004, 07:04 PM   #2
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
http://www-106.ibm.com/developerwork...-partplan.html

Last edited by 2damncommon; 10-09-2004 at 07:09 PM.
 
Old 10-09-2004, 08:20 PM   #3
shultzc
LQ Newbie
 
Registered: Feb 2004
Location: Portland, Oregon
Distribution: Debian, FreeBSD, Solaris, Mac OS X
Posts: 22

Rep: Reputation: 15
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.

Good luck with whatever you choose.

Last edited by shultzc; 10-10-2004 at 01:28 AM.
 
Old 10-09-2004, 11:18 PM   #4
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
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?
 
Old 10-10-2004, 01:36 AM   #5
shultzc
LQ Newbie
 
Registered: Feb 2004
Location: Portland, Oregon
Distribution: Debian, FreeBSD, Solaris, Mac OS X
Posts: 22

Rep: Reputation: 15
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.

Good luck!
 
Old 10-10-2004, 01:41 AM   #6
shultzc
LQ Newbie
 
Registered: Feb 2004
Location: Portland, Oregon
Distribution: Debian, FreeBSD, Solaris, Mac OS X
Posts: 22

Rep: Reputation: 15
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.
 
Old 10-12-2004, 02:30 AM   #7
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
I used cfdisk to create three logical partitions:

/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.
 
Old 10-12-2004, 03:28 AM   #8
shultzc
LQ Newbie
 
Registered: Feb 2004
Location: Portland, Oregon
Distribution: Debian, FreeBSD, Solaris, Mac OS X
Posts: 22

Rep: Reputation: 15
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.
 
Old 10-12-2004, 03:45 AM   #9
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
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.
 
Old 10-12-2004, 04:03 AM   #10
shultzc
LQ Newbie
 
Registered: Feb 2004
Location: Portland, Oregon
Distribution: Debian, FreeBSD, Solaris, Mac OS X
Posts: 22

Rep: Reputation: 15
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.)

Did you get all that?
 
Old 10-12-2004, 04:04 AM   #11
shultzc
LQ Newbie
 
Registered: Feb 2004
Location: Portland, Oregon
Distribution: Debian, FreeBSD, Solaris, Mac OS X
Posts: 22

Rep: Reputation: 15
I'm heading to sleep... I will reply (if needed) to any messages tomorrow... I have a biochemistry exam in the morning...
 
Old 10-12-2004, 07:00 AM   #12
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
You wrote your post while I was editing my last one... I got FAT32 partitioned in Windows and got it working.

Anyway, after reading your newest post, I did as you said, and it works! Thanks a lot for your considerable help, I appreciate it.
Code:
root@yos / # df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 8385660   2882984   5502676  35% /
/dev/root              8385660   2882984   5502676  35% /
/dev/hda6             10000072    295220   9704852   3% /home
/dev/hda5               994036     35428    958608   4% /winux
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.
 
Old 10-13-2004, 03:02 AM   #13
CGameProgrammer
Member
 
Registered: Oct 2004
Distribution: Yoper
Posts: 30

Original Poster
Rep: Reputation: 15
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).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Partition mounting/KDE errors after creating Fat32 Partition BertBert Linux - General 1 07-07-2004 10:59 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
creating new partition before boot partition?? rose_bud4201 Linux - General 17 02-07-2003 12:25 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 08:45 AM
Creating a mini-linux home-made distribution nutshell Linux - General 51 07-13-2002 10:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration