Help Failing Disk Problem
I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? Thanks ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
On Mon, 2007-11-05 at 11:53 -0800, Sean Murphy wrote: I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? Thanks The best way is to do it regularly before the hard drive is failing. Given that you haven't done that, there're a few methods. I'm a big fan of rsync, which is the nectar of the gods, but a lot of folks seem to prefer dd for this kind of thing. There was a thread not long ago about how best to duplicate a drive. James ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
At 01:53 PM 11/5/2007, Sean Murphy wrote: I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? Thanks If you buy a new disk most disk manufacturer's have cloning software. However if you are having media failure errors it can be difficult to get the data off. You may be able to just get the data you need off this disk by copying to a new disk, or top tape, or a usb disk. If you know what data you need like: /etc /usr/local/etc /usr/local/data you may be better to just copy those trees off. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
On Mon, 5 Nov 2007, Sean Murphy wrote: I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK -Warren Block * Rapid City, South Dakota USA ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
Try to connect the bad one as a secondary HD to get the data if u can not clone it.. Thanks Hakan http://dominor.com On Nov 5, 2007 3:50 PM, Derek Ragona [EMAIL PROTECTED] wrote: At 01:53 PM 11/5/2007, Sean Murphy wrote: I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? Thanks If you buy a new disk most disk manufacturer's have cloning software. However if you are having media failure errors it can be difficult to get the data off. You may be able to just get the data you need off this disk by copying to a new disk, or top tape, or a usb disk. If you know what data you need like: /etc /usr/local/etc /usr/local/data you may be better to just copy those trees off. -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
On Mon, 5 Nov 2007, James wrote: On Mon, 2007-11-05 at 11:53 -0800, Sean Murphy wrote: I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? The best way is to do it regularly before the hard drive is failing. Given that you haven't done that, there're a few methods. I'm a big fan of rsync, which is the nectar of the gods, but a lot of folks seem to prefer dd for this kind of thing. rsync is too high-level, and may not do exactly the right thing with links or sparse files or who knows what. dd is too low-level--you get the same partition table/bsdlabel and the exact same slice/partition sizes. That's okay on an identical hard drive, but a pain on one that's larger. dump, on the other hand, is just right. -Warren Block * Rapid City, South Dakota USA ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
On Mon, 2007-11-05 at 14:04 -0700, Warren Block wrote: On Mon, 5 Nov 2007, James wrote: On Mon, 2007-11-05 at 11:53 -0800, Sean Murphy wrote: I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? The best way is to do it regularly before the hard drive is failing. Given that you haven't done that, there're a few methods. I'm a big fan of rsync, which is the nectar of the gods, but a lot of folks seem to prefer dd for this kind of thing. rsync is too high-level, and may not do exactly the right thing with links or sparse files or who knows what. rsync -cav takes cares of symlinks and all that just right. It's a beautiful thing. Checksumming, too. Ah, bliss. dd is too low-level--you get the same partition table/bsdlabel and the exact same slice/partition sizes. That's okay on an identical hard drive, but a pain on one that's larger. dump, on the other hand, is just right. -Warren Block * Rapid City, South Dakota USA dump has the problem that a lot of tools have, though, including rsync. It creates a file list to start from. If the file names on the drive change during the dump, corruption can occur. At least on linux. I remember Torvalds ranting about it on a mailing list. I imagine FreeBSD suffers the same issue, though, as it's a pretty generic problem. dump is a good tool, though, no arguments really here. James ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
On Mon, Nov 05, 2007 at 03:16:46PM +, James wrote: rsync is too high-level, and may not do exactly the right thing with links or sparse files or who knows what. rsync -cav takes cares of symlinks and all that just right. It's a beautiful thing. Checksumming, too. Ah, bliss. It doesn't necessarily do the right thing with flags, acls and other extended attributes, dd is too low-level--you get the same partition table/bsdlabel and the exact same slice/partition sizes. That's okay on an identical hard drive, but a pain on one that's larger. dump, on the other hand, is just right. If the file names on the drive change during the dump, corruption can occur. At least on linux. I remember Torvalds ranting about it on a mailing list. I imagine FreeBSD suffers the same issue, though, as it's a pretty generic problem. For starters, you should _never_ dump a live filesystem. What you can do is dump a snapshot of a live filesystem, using dumps '-L' option, because a snapshot is like a frozen image of the filesystem; it doesn't change. Dump restore is the best way to move data and all attributes to a larger disk. See §9.2 of the FAQ. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpQI3Oof6eue.pgp Description: PGP signature
Re: Help Failing Disk Problem
On Mon, Nov 05, 2007 at 11:53:13AM -0800, Sean Murphy wrote: I have a FreeBSD 6.2 Release box with a single ide that has user data and the FreeBSD OS on a hard disk that is failing. I need advice on the best way to clone the entire disk (or at least the data) onto a larger ide disk drive, then pull the failing disk and replace it with the clone. What is the best way in FreeBSD to do that? If you can get the new disk physically installed and recognized and running before the old disk completely fails, then it should be no problem. Build the file systems on the new disk as you want them, then use dump/retore to move the data. The dump/restore needs to be done one filesystem at a time. NOTE: For best results, this should all be done in single user mode with no other thing running to avoid changes in files confusing things. It will work in full multi user mode, but you may get some files in indeterminate condition if they happen to change during the copy process. Either use sysinstall (/usr/sbin/sysinstall) to slice and partition the new drive and build file systems on it or do it yourself with fdisk, bsdlabel and newfs. Since you are using a larger drive, think out the sizes you want for the partitions on the new drive. I am guessing from the way you talk here, that the system is not dual booted with some other OS. Given that presumption: (This is right out of the bsdlabel man page, by the way. I just changed numbers and device names to fit the situation) NOTE: The dd-s below are just to make sure the label areas and such are wiped clean in case the manufacturer made some presumptions and wrote something there. They might not really be needed, but won't hurt anything and take just a moment. Create one large slice, marked bootable for FreeBSD: dd if=/dev/zero of=/dev/ad1 bs=512 count=1024 fdisk -BI da0 Write a basic label and boot record on the slice: dd if=/dev/zero of=/dev/ad1s1 bs=512 count=1024 bsdlabel -w -B ad1s1 Partition the slice by using the edit function of bsdlabel: bsdlabel -e ad1s1 This will put you in an edit screen with the beginnings of partition information. Ignore anything it might have before the lines that read: # /dev/ad1s1: 8 partitions: # size offsetfstype [fsize bsize bps/cpg] After that you will see a list of partitions. There should only be one 'c' partition listed. Do not change that line, but copy it enough times to have one for each partition you want. Lets say you want root, swap, /tmp, /usr, /var and /home. Then make it something like: # /dev/ad1s1: 8 partitions: # size offsetfstype [fsize bsize bps/cpg] a: 52428804.2BSD2048 16384 32776 b: 2572288* swap c: 783168750unused 0 0# raw part, don't edit d: 1048576*4.2BSD2048 16384 8 e: 4194304*4.2BSD2048 16384 28552 f: 6291456*4.2BSD2048 16384 28552 g:**4.2BSD2048 16384 28552 Then just :wq out of the edit session and your label is nicely written. Using the stars for offset and final size tells bsdlabel to calculate the offsets for you and make the last partition take up all the remaining available space. The first partition should have the offset specified as '0'.The numbers I have here are in 512 byte blocks and give the following sizes.Choose your own according to your needs. a: 256 MBI mount as / b: 1256 MBis swap d: 512 MBI mount as /tmp e: 2048 MBI mount as /usr f: 3072 MBI mount as /var g: Remainder MB I mount as /home Once that is finished, then you need to run new fs on each partition except the one for swap (b). eg. newfs a, d, e, f, g Generally, unless you need extra inodes for a lot of small files or expect only unusually large files, you can just take the defaults for newfs. so: newfs /dev/ad1s1a newfs /dev/ad1s1d newfs /dev/ad1s1e newfs /dev/ad1s1f newfs /dev/ad1s1g Now you need to make mount points for and mount each partition. Something like: mkdir /newroot mount /dev/ad1s1a /newroot mkdir /newusr mount /dev/ad1s1e /newusr mkdir /newvar mount /dev/ad1s1f /newvar mkdir /newhome mount /dev/ad1s1g /newhome You don't usually need to copy /tmp to the new disk, though you can do that if you want as well. Then do the dump/restore-s cd /newroot dump 0af - / | restore -rf - cd /newusr dump 0af - /usr | restore -rf - cd /newvar dump 0af - /var | restore -rf - cd /newhome dump 0af - /home | restore -rf - At the end of each dump it might ask you if you want to set permissions on . just answer no. I don't think it does that with the restore -r, but if it does, then answer no. After all this, you should be able to just physically switch the disks and boot on the new one. jerry Thanks
Re: Help Failing Disk Problem
Roland, The mention of dump '-L' in your email below has caught my attention. Pardon my ignorance, but what is the '-L' option? I looked it up in the man pages but wasn't able to find any mention of it. Can you point me in the right direction? Thanks, - FX - Original Message From: Roland Smith [EMAIL PROTECTED] To: James [EMAIL PROTECTED] Cc: Sean Murphy [EMAIL PROTECTED]; freebsd-questions@freebsd.org Sent: Monday, November 5, 2007 4:58:47 PM Subject: Re: Help Failing Disk Problem On Mon, Nov 05, 2007 at 03:16:46PM +, James wrote: rsync is too high-level, and may not do exactly the right thing with links or sparse files or who knows what. rsync -cav takes cares of symlinks and all that just right. It's a beautiful thing. Checksumming, too. Ah, bliss. It doesn't necessarily do the right thing with flags, acls and other extended attributes, dd is too low-level--you get the same partition table/bsdlabel and the exact same slice/partition sizes. That's okay on an identical hard drive, but a pain on one that's larger. dump, on the other hand, is just right. If the file names on the drive change during the dump, corruption can occur. At least on linux. I remember Torvalds ranting about it on a mailing list. I imagine FreeBSD suffers the same issue, though, as it's a pretty generic problem. For starters, you should _never_ dump a live filesystem. What you can do is dump a snapshot of a live filesystem, using dumps '-L' option, because a snapshot is like a frozen image of the filesystem; it doesn't change. Dump restore is the best way to move data and all attributes to a larger disk. See §9.2 of the FAQ. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
On Mon, Nov 05, 2007 at 02:40:36PM -0800, FX Charpentier wrote: Roland, The mention of dump '-L' in your email below has caught my attention. Pardon my ignorance, but what is the '-L' option? I looked it up in the man pages but wasn't able to find any mention of it. Can you point me in the right direction? It stands for 'Live' and causes dump to do some snapshotting if you are running from multi user. It is not really meaningful if you are running in single user mode, but can help reduce confusion if files change during a dump on a live multi user mode system. jerry Thanks, - FX ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
Thanks. I might actually use this on a box I'm running. Best, - FX - Original Message From: Jerry McAllister [EMAIL PROTECTED] To: FX Charpentier [EMAIL PROTECTED] Cc: Roland Smith [EMAIL PROTECTED]; James [EMAIL PROTECTED]; Sean Murphy [EMAIL PROTECTED]; freebsd-questions@freebsd.org Sent: Monday, November 5, 2007 7:18:57 PM Subject: Re: Help Failing Disk Problem On Mon, Nov 05, 2007 at 02:40:36PM -0800, FX Charpentier wrote: Roland, The mention of dump '-L' in your email below has caught my attention. Pardon my ignorance, but what is the '-L' option? I looked it up in the man pages but wasn't able to find any mention of it. Can you point me in the right direction? It stands for 'Live' and causes dump to do some snapshotting if you are running from multi user. It is not really meaningful if you are running in single user mode, but can help reduce confusion if files change during a dump on a live multi user mode system. jerry Thanks, - FX __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
James [EMAIL PROTECTED], said on Mon Nov 05, 2007 [03:16:46 PM]: } On Mon, 2007-11-05 at 14:04 -0700, Warren Block wrote: } } On Mon, 5 Nov 2007, James wrote: } } On Mon, 2007-11-05 at 11:53 -0800, Sean Murphy wrote: } } I have a FreeBSD 6.2 Release box with a single ide that has user data } and the FreeBSD OS on a hard disk that is failing. I need advice on the } best way to clone the entire disk (or at least the data) onto a larger } ide disk drive, then pull the failing disk and replace it with the } clone. What is the best way in FreeBSD to do that? } } The best way is to do it regularly before the hard drive is failing. } } Given that you haven't done that, there're a few methods. I'm a big fan } of rsync, which is the nectar of the gods, but a lot of folks seem to } prefer dd for this kind of thing. } } rsync is too high-level, and may not do exactly the right thing with } links or sparse files or who knows what. } } rsync -cav takes cares of symlinks and all that just right. It's a } beautiful thing. } } Checksumming, too. Ah, bliss. Reading the man page, I believe that will make copies instead of hard links for files with more than one link. By my reading, you'd have to specify -H in addition. As others have pointed out, if you're using ACLs or other extended attributes, those may be lost as well. This is why I think _in principle_ using a tool which has as its sole purpose in life the backup and restore, unmolested, of filesystems, is the best general approach to this problem. Other tools may work too, but you have to put a lot of thought and care into getting 473 of their 1692 command line options right (made up numbers, obviously) and that's never good when you're in the heat of the moment and your data is at stake. } dump has the problem that a lot of tools have, though, including rsync. } It creates a file list to start from. } } If the file names on the drive change during the dump, corruption can } occur. At least on linux. I remember Torvalds ranting about it on a } mailing list. I imagine FreeBSD suffers the same issue, though, as it's } a pretty generic problem. Use dump (or anything else, for that matter) on a snapshot. Of course, all bets are off since the disk is already failing. The common case is that the OP may get most of the files off in tact; probably not all. Backups are important if you care about your data. -- Jon Hamilton [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Help Failing Disk Problem
On Mon, Nov 05, 2007 at 02:40:36PM -0800, FX Charpentier wrote: Roland, The mention of dump '-L' in your email below has caught my attention. Pardon my ignorance, but what is the '-L' option? I looked it up in the man pages but wasn't able to find any mention of it. Can you point me in the right direction? It's in dump(8); -L This option is to notify dump that it is dumping a live file sys- tem. To obtain a consistent dump image, dump takes a snapshot of the file system in the .snap directory in the root of the file system being dumped and then does a dump of the snapshot. The snapshot is unlinked as soon as the dump starts, and is thus removed when the dump is complete. This option is ignored for unmounted or read-only file systems. If the .snap directory does not exist in the root of the file system being dumped, a warning will be issued and the dump will revert to the standard behavior. This problem can be corrected by creating a .snap directory in the root of the file system to be dumped; its owner should be ``root'', its group should be ``operator'', and its mode should be ``0770''. I use dump with the following options (e.g. for /usr); dump -0 -B 4589560 -C 8 -h 0 -L -u -P \ 'cat - usr-0-20071106-vol${DUMP_VOLUME}.dump' /usr This splits dump output in DVD-R sized chunks. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpvj8pXniSED.pgp Description: PGP signature
Re: Help Failing Disk Problem
I use dump with the following options (e.g. for /usr); dump -0 -B 4589560 -C 8 -h 0 -L -u -P \ 'cat - usr-0-20071106-vol${DUMP_VOLUME}.dump' /usr This splits dump output in DVD-R sized chunks. completely strange better -f file1,file2,file3,. (you may type more files than actually needed). one unneeded extra pipe avoided. if you use pipe, use with growisofs. BUT with DVD+RW disks you may use /dev/cd0 directly as dump device ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]