How?
I'm able to do Linux and M$ partitions successfully on my PC with Fedora 2. I want to see how to do it so I can write an article on it. I'll admit to only a one hour google search today (I was so happy to get ANYTHING working I had to test it as soon as I could). I found a lot of pages referring to Linux on the Mac and a bunch of pages saying they were out of date with the 2.4 kernel. I *should* be able to test the Mac/HFS partition this weekend.
The odd thing is if I had the USB card for my Apple// I could format it there... Unfortunately I've already blown a bunch of money on the new harddrive (on sale at Itech) and USB box.
Later Mike
Mike Pfaiffer wrote:
How?
I'm able to do Linux and M$ partitions successfully on my PC with Fedora 2. I want to see how to do it so I can write an article on it. I'll admit to only a one hour google search today (I was so happy to get ANYTHING working I had to test it as soon as I could). I found a lot of pages referring to Linux on the Mac and a bunch of pages saying they were out of date with the 2.4 kernel. I *should* be able to test the Mac/HFS partition this weekend.
The odd thing is if I had the USB card for my Apple// I could format it there... Unfortunately I've already blown a bunch of money on the new harddrive (on sale at Itech) and USB box.
Later Mike
What I could glean from a quick couple Google searches was that you need to get and build the diskdev_cmds package from Darwin, using a patch to make it compile on Linux (there seems to be some of these floating around on the web). Then you use the newfs or newfs_hfs program from that package.
On September 23, 2005 10:38 am, Gilles Detillieux wrote this amazing epistle:
Mike Pfaiffer wrote:
How?
I'm able to do Linux and M$ partitions successfully on my PC with Fedora 2. I want to see how to do it so I can write an article on it. I'll admit to only a one hour google search today (I was so happy to get ANYTHING working I had to test it as soon as I could). I found a lot of pages referring to Linux on the Mac and a bunch of pages saying they were out of date with the 2.4 kernel. I *should* be able to test the Mac/HFS partition this weekend.
The odd thing is if I had the USB card for my Apple// I could format it there... Unfortunately I've already blown a bunch of money on the new harddrive (on sale at Itech) and USB box.
Later Mike
What I could glean from a quick couple Google searches was that you need to get and build the diskdev_cmds package from Darwin, using a patch to make it compile on Linux (there seems to be some of these floating around on the web). Then you use the newfs or newfs_hfs program from that package.
Thanks. I'll grab the package this afternoon. It turns out a couple of Mac people may benefit from this as well (they are newbies and want me to format harddrives on my machine for them - one couldn't get a 200GB drive working properly).
Later Mike
I will soon make a fresh install of Fedora Core 4, and I have a very limited knowledge of Linux. I would like to maximize interoperability with other systems, and make backup as easy as possible.
I want to install it on my gateway machine, a Pentium3 with 2 removable IDE drive bays. Ideally, I want:
1) EASY BACKUP - on another machine I run Windows 2000 to take full advantage of my ATI All-in-Wonder 9600 pro. That machine also has 2 removable IDE drive bays, so I can copy entire partitions from one drive to the other. I cannot use Windows to copy the OS and apps while Windows is running, because some of the files are locked. I boot to DOS from a floppy, and use a DOS program (DriveStar) to copy from one hard drive to the other. Then I use the backup to work from. This works, but Windows remembers individual drive serial numbers so it assigns different drive letters and I have to change some of my links. Linux does not have this problem - hdb6 is always the second logical partition on the second drive, even if I change the second drive. Can Linux copy itself while it is running? I may even use software RAID mirroring - though that would prevent me from switching to different drives with different data in the second drive slot (or can it be turned on and off easily?)
2) SHARING DATA - users should be able to access the same /home directory whether running on the new system or on another machine on the network which is running Suse 9.0. I'm guessing that /home would not even have to be on a separate partition, though it is probably wise to do that. It would be nice if I could also share data with the Windows machine. I'm not sure if, for example, the Mozilla prefs/user files are the same for Windows as Linux, so that I could access my email from Windows or from Linux and not have the mail end up in different places.
3) SHARING APPS - I currently have Mandrake 8.1 installed on the machine that I am targeting for Fedora. It would be great if I could run some of the apps already installed with Mandrake, while I am running Fedora. It would also be nice if I could run some of the apps from the other machine running Suse. I'm guessing that this is not easy - that sharing /usr and /opt would lead to dependency issues and incompatible libraries.
4) MIGRATING TO OTHER HARDWARE - Another bonus would be if I could take my hard drive with Fedora installed, and pop it into my Pentium 4 (usually running Windows) to run an app that needs more juice. I could use LILO to present a menu containing "Fedora - machine A" and "Fedora - machine B" - but are there machine specific files in various parts of the filesystem? If Host 1 usually runs on Machine A, and Host 2 usually runs on Machine B, can I switch them without causing chaos?
If anyone has suggestions (preferably from experience) on how to accomplish any of these things, that would be great. If some of these things (especially 3 & 4) are not possible, please let me know.
on the second drive, even if I change the second drive. Can Linux copy itself while it is running?
Yes, but you'll have inconsistencies if files change in the middle of the copy. For the most part it's not a big issue though.
I would boot the FC4 CD/DVD in rescue mode and use dd to make an image backup:
dd if=/dev/hda of=/dev/hdc bs=65536
make sure you get your drive device identifiers right or you'll hose your disk without warning. This also assumes the 2nd drive is at least as big as the first drive.
I may even use software RAID mirroring - though that would prevent me from switching to different drives with different data in the second drive slot (or can it be turned on and off easily?)
No, sw RAID is not really useful for offline backups.
- SHARING DATA - users should be able to access the same /home
directory whether running on the new system or on another machine on the network which is running Suse 9.0. I'm guessing that /home would not even have to be on a separate partition, though it is probably wise to
You can share /home over the LAN using NFS, and that is quite common. See the many how-tos on setting up NFS.
do that. It would be nice if I could also share data with the Windows machine. I'm not sure if, for example, the Mozilla prefs/user files are the same for Windows as Linux, so that I could access my email from Windows or from Linux and not have the mail end up in different places.
Almost definitely not possible for numerous reasons.
- SHARING APPS - I currently have Mandrake 8.1 installed on the
machine that I am targeting for Fedora. It would be great if I could run some of the apps already installed with Mandrake, while I am running
Hmm, may be possible, though shared library conflicts might be an issue. Almost definitely not worth the hassle though as it will royally screw up RPM in both FC and Mandrake if you share /usr.
- MIGRATING TO OTHER HARDWARE - Another bonus would be if I could take
my hard drive with Fedora installed, and pop it into my Pentium 4 (usually running Windows) to run an app that needs more juice. I could
Hard to do because of the mkinitrd boot image which will contain IDE drivers to boot on your P3 but not your P4. You could probably fudge it to boot on both but this would be VERY advanced. Plus, kudzu would go mental each time the hardware changed. Again, not worth the hassle.
- MIGRATING TO OTHER HARDWARE - Another bonus would be if I could take
my hard drive with Fedora installed, and pop it into my Pentium 4 (usually running Windows) to run an app that needs more juice. I could
Hard to do because of the mkinitrd boot image which will contain IDE drivers to boot on your P3 but not your P4. You could probably fudge it to boot on both but this would be VERY advanced. Plus, kudzu would go mental each time the hardware changed. Again, not worth the hassle.
I agree its not worth the hassle to do it just for the heck of it because of the "advancement" of using ram disks for init. However, this can be done trivially with some Linux distributions if its a requirement.
For example, Slackware doesn't use any ram disks by default meaning just you can do a normal file copy from one disk to another, setup the master boot record on the new drive and put it in the new system and thats it. Keeping in mind you have to configure it to load required modules which you have to do with Slackware anyhow since Slackware doesn't do much hardware detection.
As long as you haven't built a custom kernel you could move the drive between most machines with ease.
Trevor Cordes wrote:
do that. It would be nice if I could also share data with the Windows machine. I'm not sure if, for example, the Mozilla prefs/user files are the same for Windows as Linux, so that I could access my email from Windows or from Linux and not have the mail end up in different places.
Almost definitely not possible for numerous reasons.
I think this is very possible. I have shared Mozilla mailboxes between Linux and Windows in the past. I saw a couple of references that sharing of Thunderbird profiles is also possible.
-- Bill
On 24 Sep, Bill Reid wrote:
Almost definitely not possible for numerous reasons.
I think this is very possible. I have shared Mozilla mailboxes between Linux and Windows in the past. I saw a couple of references that sharing of Thunderbird profiles is also possible.
If you shared the mbox file, wouldn't locking get all wacky? Say you were reading your email on Windows while your linux box was POPing some new mail into it.
And sharing profiles/bookmarks, not to mention cache directories, would have similar problems, if attempted at the file level. I think the safest bet would be to do like Adam suggested and use IMAP and maybe throw in LDAP for address books or (if Mozilla/TB support it) application layer roaming capabilities.
A lot of work for a newbie, without a lot of benefits.
Trevor Cordes wrote:
On 24 Sep, Bill Reid wrote:
Almost definitely not possible for numerous reasons.
I think this is very possible. I have shared Mozilla mailboxes between Linux and Windows in the past. I saw a couple of references that sharing of Thunderbird profiles is also possible.
If you shared the mbox file, wouldn't locking get all wacky? Say you were reading your email on Windows while your linux box was POPing some new mail into it.
I would think Samba would handle these situations.
And sharing profiles/bookmarks, not to mention cache directories, would have similar problems, if attempted at the file level. I think the safest bet would be to do like Adam suggested and use IMAP and maybe throw in LDAP for address books or (if Mozilla/TB support it) application layer roaming capabilities.
IMAP is of course the best solution but as you say not that simple to set up.
The problem with LDAP is that Mozilla/TB does not support updating the LDAP entries. Reading no problem.
-- Bill
Thanks to all for the advice re setting up my Linux system. I'm going to forget the idea of Linux distros sharing apps, and the idea of migrating between different kinds of hardware. I'm going to make partitions for DOS/Win, /boot, swap, and root (/). Once up and running, I will export /home and have other PCs mount it under their /home directories. I'm going to try sharing Mozilla files between Windows machines and Linux machines - I think I did this with Netscape once in the past. Eventually I will set up IMAP.
The problem now is partition hell. I planned on using my DOS DriveStar program to copy partitions from one drive to the other. The advantage is that I can run it from a floppy, and treat the contents of both hard drives as data, copying from one to the other. This eliminates any potential problem of data inconsistency from copying from a drive which is running the system.
I can set up partitions under Linux or using Partition Magic 7.0 (PM7) under Windows 2000. In either case, DOS based programs such as my Drive Star or PM7 under DOS detect partition errors and refuse to do anything - I can't even destroy the partitions under PM7.
After many hours of getting nowhere, I destroyed the partitions using fdisk under DOS, and set them up under PM7 running under DOS. Everything looks fine at that point. When I exit PM7, I am warned that the system will reboot. After rebooting straight back to DOS and again running PM7, it gives a partition table error and refuses to do anything to that drive - this from the program that apparently wrote the tables!
The error indicates inconsistency between how DOS reads the partition info and how other OSs (including Windows) reads it - the result is 2 different hard drive geometries being reported. I don't know how to fix this - I would have thought creating the partitions under DOS in PM7 in the first place would solve the problem - but it has still retained an alternate description of drive geometry. I can create 3 primary partitions without a problem, but if I add an extended partition that takes up the rest of the drive, I get the error.
Does the "c" command in Linux fdisk have anything to do with this? I can't see that it actually does anything.
I may have to forget Drive Star, and copy from a drive running Linux as discussed before, or have a second Linux system on the same drive that I can boot to copy the first.
Suggestions?
Bill Reid wrote:
Trevor Cordes wrote:
On 24 Sep, Bill Reid wrote:
Almost definitely not possible for numerous reasons.
I think this is very possible. I have shared Mozilla mailboxes between Linux and Windows in the past. I saw a couple of references that sharing of Thunderbird profiles is also possible.
If you shared the mbox file, wouldn't locking get all wacky? Say you were reading your email on Windows while your linux box was POPing some new mail into it.
I would think Samba would handle these situations.
And sharing profiles/bookmarks, not to mention cache directories, would have similar problems, if attempted at the file level. I think the safest bet would be to do like Adam suggested and use IMAP and maybe throw in LDAP for address books or (if Mozilla/TB support it) application layer roaming capabilities.
IMAP is of course the best solution but as you say not that simple to set up.
The problem with LDAP is that Mozilla/TB does not support updating the LDAP entries. Reading no problem.
-- Bill _______________________________________________ Roundtable mailing list Roundtable@muug.mb.ca http://www.muug.mb.ca/mailman/listinfo/roundtable
There was a lot of detail there but I think if I understand your problem correctly you are trying to occationally replicate data between 2 partitions?
The linux command "dd" is typically used for these kinds of applications. I think someone mentioned it in a previous email on this topic?
dd does not care what data is on the drive, if its mounted or in use, or about partitions or anything of the sort. The only time dd will fail is when it encounters an error while trying to read or write.
So, a brief example would be:
# dd if=/dev/hda2 of=/dev/hdb2 bs=1M
This will move all data from the device /dev/hda2 (second partition of the first drive) to the device /dev/hdb2 (second partition of the second drive) using a block sizes of 1M (bs=1M is optional but it will speed up the process since I believe the default is to read 1 byte at a time).
As mentioned, dd does not care about partitions so it can also be used to replicate the entire drive (assuming the destination is at least as big as the source drive)
# dd if=/dev/hda of=/dev/hdb bs=1M
As mentioned, dd will only fail if dd encounters an error which typically would be one of:
1) device /dev/hda2 has a read error 2) device /dev/hdb2 has a write error 3) device /dev/hdb2 is smaller than /dev/hda2
As a side note, dd can be very useful for testing the media on a device. For example:
read test:
# dd if=/dev/hda2 of=/dev/null bs=1M
write test (CAUTION! WIPES ALL DATA!):
# dd if=/dev/zero of=/dev/hda2 bs=1M
NOTE: little known fact: a failure on a read test really doesn't mean anything. From time to time drives will develop bad sectors and the drive itself will re-allocate those bad sectors to other places on the disk automatically BUT it only does this on a WRITE operation! Therefore a drive may repeatedly fail a read test but will successfully pass a write test and from then on will pass read tests as the bad sector has now been remapped after the write operation and the drive will work perfectly fine for years to come.
If you are concerned about a drive failing you should use SMARTMON tools to actually read the hardware status of the drive and notify you of impending drive failure. These tools are actually very accurate at detecting failing drives before they fail though you often only get less than 24 hours notice to get your data off.
Dan Martin wrote:
The error indicates inconsistency between how DOS reads the partition info and how other OSs (including Windows) reads it - the result is 2 different hard drive geometries being reported. I don't know how to fix this - I would have thought creating the partitions under DOS in PM7 in the first place would solve the problem - but it has still retained an alternate description of drive geometry. I can create 3 primary partitions without a problem, but if I add an extended partition that takes up the rest of the drive, I get the error. Does the "c" command in Linux fdisk have anything to do with this? I can't see that it actually does anything.
Short answer: turn on LBA support in your BIOS. Don't use 'auto' or 'large drive support', if you can avoid it, and especially avoid 'chs' settings.
That may not be sufficient, it depends on what version of DOS you're running.
Unfortunately, if you turn on LBA (or LBA32) mode, your partition table will be scrambled... but even worse, if you boot from DOS it will still read sector 0 from the drive and infer geometry from what it finds there, not from the BIOS. The easiest way around this is to turn on LBA, then immediately install Windows 2000 or Windows XP or Linux. Don't even try booting DOS until you've successfully recreated the partition table under a more advanced OS. Do NOT try "fixing" things with PartitionMagic at this point, it will just make a worse mess.
(If you boot a Linux kernel, during the boot sequence it identified the disks it found. Output from 'dmesg' should indicate "hda: ....." and it should show some sort of indication as to whether the disk geometry is in C/H/S mode or LBA mode.)
You might want to read the Large Disk HOWTO, found at: http://www.tldp.org/HOWTO/Large-Disk-HOWTO.html as it discusses the sort of thing that I think you're running into.
-Adam
Adam:
Thanks a bunch! That's exactly what the problem is. Soime time ago I changed my IDE connections, but neglected to change the BIOS. hda used LBA addressing, but hdc used AUTO, which defaulted to CHS. This explains some of life's mysteries, like why 2 identical drives appear different.
I will have to look at partitions on my P4, since the BIOS is set to AUTO for those, and the drives have both DOS and Linux partitions. I hope those partition tables are consistent.
I assume the need for LBA settings is relevant only if 1) using DOS, or, 2) using LILO since Linux does not depend on the BIOS addressing.
Is there ever a good reason to NOT use LBA? [perhaps installing an ancient drive with stuff on it partitioned under an old scheme?] In theory, files could be arranged by cylinder to minimize seek times, but in fact the CHS geometries are not "real" anyways, so no benefit there.
Thanks again.
Adam Thompson wrote:
Short answer: turn on LBA support in your BIOS. Don't use 'auto' or 'large drive support', if you can avoid it, and especially avoid 'chs' settings.
That may not be sufficient, it depends on what version of DOS you're running.
Unfortunately, if you turn on LBA (or LBA32) mode, your partition table will be scrambled... but even worse, if you boot from DOS it will still read sector 0 from the drive and infer geometry from what it finds there, not from the BIOS. The easiest way around this is to turn on LBA, then immediately install Windows 2000 or Windows XP or Linux. Don't even try booting DOS until you've successfully recreated the partition table under a more advanced OS. Do NOT try "fixing" things with PartitionMagic at this point, it will just make a worse mess.
(If you boot a Linux kernel, during the boot sequence it identified the disks it found. Output from 'dmesg' should indicate "hda: ....." and it should show some sort of indication as to whether the disk geometry is in C/H/S mode or LBA mode.)
You might want to read the Large Disk HOWTO, found at: http://www.tldp.org/HOWTO/Large-Disk-HOWTO.html as it discusses the sort of thing that I think you're running into.
-Adam