Re: Mdadm: can I resize the partition of a mdam if I have only one primary partition per disk and RAID 1? In yast?
On 1/19/23 14:19, Stratos Zolotas wrote:
I suppose something like
mdadm --grow --size max /dev/md0
I would not grow to max, but "max - 300M". A replacement 8T drive may not have exactly the same "max" size preventing syncing to the new drive. It is always recommended to leave 1/4 to 1G unused for this reason. -- David C. Rankin, J.D.,P.E.
In data venerdì 20 gennaio 2023 08:35:39 CET, David C. Rankin ha scritto:
On 1/19/23 14:19, Stratos Zolotas wrote:
I suppose something like
mdadm --grow --size max /dev/md0
I would not grow to max, but "max - 300M". A replacement 8T drive may not have exactly the same "max" size preventing syncing to the new drive. It is always recommended to leave 1/4 to 1G unused for this reason.
the good thing is that both drives are now exactly identical (same producer, same type, same size, set up as Raid1 via mdadm from scratch. Now I haven't yet mounted (which I will do simply as "/transfer" ) and have the /home on a degraded RAID 1 with one 4 TB drive. (The other has been used for the RAID. Now the "1000$" question: what is the best command to achieve the transfer of the /home to the new /transfer home? cp? rsync? dd? Any suggestions for the best (eventually fastest but I would prefer most reliable) solution? Thank you.
On 1/20/23 03:33, Stakanov wrote:
Now the "1000$" question: what is the best command to achieve the transfer of the /home to the new /transfer home?
cp? rsync? dd?
Any suggestions for the best (eventually fastest but I would prefer most reliable) solution?
For transferring /home - take your pick. "cp -a" is fine, "rsync -a" is also fine, "dd" is fine, but you need several additional options to set block-size, etc... or it will be horribly slow compared with cp or rsync. So if you have the new partition mounted as "/mnt/trasfer" and you are copying from your "/home" partition, you can do: # cp -a /home/* /mnt/transfer So long as you have no dot-files in /home (you shouldn't), then there is no need for a second "cp -a /home/.* /mnt/transfer". -- David C. Rankin, J.D.,P.E.
David, et al -- ...and then David C. Rankin said... % % For transferring /home - take your pick. "cp -a" is fine, "rsync -a" is also ... % % So long as you have no dot-files in /home (you shouldn't), then there is no % need for a second "cp -a /home/.* /mnt/transfer". Make that .??* .[A-Za-z0-9] to ensure that you don't try to copy the parent directory :-) [We will presume you don't have sneaky dot-space or dot-null dirs in there.] HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt
Stakanov wrote:
Any suggestions for the best (eventually fastest but I would prefer most reliable) solution?
rsync. Mainly because it is restartable. -- Per Jessen, Zürich (-1.7°C) Member, openSUSE Heroes (2016 - present) We're hiring - https://en.opensuse.org/openSUSE:Heroes
In data venerdì 20 gennaio 2023 10:44:57 CET, Per Jessen ha scritto:
Stakanov wrote:
Any suggestions for the best (eventually fastest but I would prefer most reliable) solution?
rsync. Mainly because it is restartable.
Thank you David, thank you Per, thank you Carlos. So, Per has an argument here (Per be proud, will ya!) that it is restartable, because with my luck you can be sure something WILL go South on me (although at least I can exclude power cuts as I am on a UPS APC :-) But yes, I think this is quite a "killer argument" for this kind of job. "dot files" well, I "shouldn't" but KDE has actually, all files under config etc are situated as dot files of the user, also settings of kmail, so, does rsync take these too?
On 2023-01-20 13:13, Stakanov wrote: ...
But yes, I think this is quite a "killer argument" for this kind of job. "dot files" well, I "shouldn't" but KDE has actually, all files under config etc are situated as dot files of the user, also settings of kmail, so, does rsync take these too?
Yes, unless you give a pattern that excludes them. --archive, -a archive mode; equals -rlptgoD (no -H,-A,-X) --recursive, -r recurse into directories --links, -l copy symlinks as symlinks --perms, -p preserve permissions --times, -t preserve modification times --group, -g preserve group --owner, -o preserve owner (super-user only) -D same as --devices --specials --devices preserve device files (super-user only) --specials preserve special files Mmm. Could use: --atimes, -U preserve access (use) times --open-noatime avoid changing the atime on opened files --crtimes, -N preserve create times (newness) Paranoid mode: run 'mc' in another terminal, and look at the destination directory while it is running, to see if you see files that should not be there, or the reverse :-D -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
On 1/20/23 04:13, Stakanov wrote:
So, Per has an argument here (Per be proud, will ya!) that it is restartable, because with my luck you can be sure something WILL go South on me (although at least I can exclude power cuts as I am on a UPS APC:-)
Hi Stakanov! I ran Sun Microsystem server kit back in the '90's and had a nice 10-kVA UPS system. Over the maybe 7 or 8 years that I ran it I can't think of one time where it protected us from power outages. But there were many outages caused by the UPS! We would have been better off without it. If anyone's interested, it was a Best (now Eaton) FERRUPS 10-kVA system. https://www.eaton.com/us/en-us/catalog/backup-power-ups-surge-it-power-distr... The battery bank was as big as the main unit. It's still sitting in the corner of the server room, unused. Yes, I highly recommend rsync, I use it all the time. Regards, Lew
On 1/20/23 06:13, Stakanov wrote:
But yes, I think this is quite a "killer argument" for this kind of job. "dot files" well, I "shouldn't" but KDE has actually, all files under config etc are situated as dot files of the user, also settings of kmail, so, does rsync take these too?
Dot-files are fine further down in the directory structure, but when copying /home you don't want to have: /home/.somestrangefile Having /home/stakanov/.allthedotfilesyouwant Is no problem. The only issue with having dot files under /home is they wouldn't be caught with a 'cp -a /home/* /mnt/transfer'. You can copy them individually or, rsync can handle them with rsync -aP /home/ /mnt/transfer **note:** the trailing '/' after home -- required to copy "contents of" rather than the "directory itself". -- David C. Rankin, J.D.,P.E.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El 2023-01-20 a las 10:33 +0100, Stakanov escribió:
In data venerdì 20 gennaio 2023 08:35:39 CET, David C. Rankin ha scritto:
On 1/19/23 14:19, Stratos Zolotas wrote:
...
Now the "1000$" question: what is the best command to achieve the transfer of the /home to the new /transfer home?
cp? rsync? dd?
Any suggestions for the best (eventually fastest but I would prefer most reliable) solution?
rsync. - From my backup script incantation: DESTINO=/path/to/destination ORIGEN=/path/to/source/ OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable " If the source is mounted and you make a second run: OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable --del" rsync $OPTIONS \ --relative --include=/data/vmware** --include=/data/storage_** --include=/data/cripta** --include=/data/xtr** --include=/data/raid** \ --exclude=/lost+found --exclude=/dev --exclude=/sys --exclude=/proc --exclude=/run \ --exclude=/data/** --exclude=/mnt --exclude=/other --exclude=/media --exclude=/var/lib/samba/lock/ --exclude=/var/run/ \ $ORIGEN $DESTINO Notice that destination misses the end slash, but not the source. You have to remove out the options you don't need, but I left them as examples. I think you may need just this: rsync $OPTIONS \ /oldhome/ /newhome - -- Cheers, Carlos E. R. (from openSUSE 15.4 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCY8qEnhwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVTpkAoIks2FpDRQtI9SgOwj4L oACypo/rAJ9pOzRIzNeGLH2z4rssmMOgEpmqJw== =52Jz -----END PGP SIGNATURE-----
In data venerdì 20 gennaio 2023 13:10:05 CET, Carlos E. R. ha scritto:
El 2023-01-20 a las 10:33 +0100, Stakanov escribió:
In data venerdì 20 gennaio 2023 08:35:39 CET, David C. Rankin ha scritto:
On 1/19/23 14:19, Stratos Zolotas wrote: ...
Now the "1000$" question: what is the best command to achieve the transfer of the /home to the new /transfer home?
cp? rsync? dd?
Any suggestions for the best (eventually fastest but I would prefer most reliable) solution?
rsync.
From my backup script incantation:
DESTINO=/path/to/destination ORIGEN=/path/to/source/
OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable "
If the source is mounted and you make a second run:
OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable --del"
rsync $OPTIONS \ --relative --include=/data/vmware** --include=/data/storage_** --include=/data/cripta** --include=/data/xtr** --include=/data/raid** \ --exclude=/lost+found --exclude=/dev --exclude=/sys --exclude=/proc --exclude=/run \ --exclude=/data/** --exclude=/mnt --exclude=/other --exclude=/media --exclude=/var/lib/samba/lock/ --exclude=/var/run/ \ $ORIGEN $DESTINO
Notice that destination misses the end slash, but not the source. You have to remove out the options you don't need, but I left them as examples. I think you may need just this:
rsync $OPTIONS \ /oldhome/ /newhome
-- Cheers, Carlos E. R. (from openSUSE 15.4 x86_64 at Telcontar) I finally did: rsync avxHAX --progress2 /home/ /transfer
currently running.
On 2023-01-20 21:59, Stakanov wrote:
In data venerdì 20 gennaio 2023 13:10:05 CET, Carlos E. R. ha scritto:
El 2023-01-20 a las 10:33 +0100, Stakanov escribió:
In data venerdì 20 gennaio 2023 08:35:39 CET, David C. Rankin ha scritto:
On 1/19/23 14:19, Stratos Zolotas wrote:
OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable "
If the source is mounted and you make a second run:
OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable --del"
...
I finally did: rsync avxHAX --progress2 /home/ /transfer
Let me see: --archive, -a archive mode; equals -rlptgoD (no -H,-A,-X) --verbose, -v increase verbosity --one-file-system, -x don't cross filesystem boundaries --hard-links, -H preserve hard links --acls, -A preserve ACLs (implies --perms) --xattrs, -X preserve extended attributes I would add --sparse. "--progress2" is not in my manual, I don't know what it is. If it is a typo, and it really is "--progress", I find it too verbose, so if there is an error it flows fast out of the display and I never see it.
currently running.
-- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
In data venerdì 20 gennaio 2023 21:59:02 CET, Stakanov ha scritto:
In data venerdì 20 gennaio 2023 13:10:05 CET, Carlos E. R. ha scritto:
El 2023-01-20 a las 10:33 +0100, Stakanov escribió:
In data venerdì 20 gennaio 2023 08:35:39 CET, David C. Rankin ha scritto:
On 1/19/23 14:19, Stratos Zolotas wrote: ...
Now the "1000$" question: what is the best command to achieve the transfer of the /home to the new /transfer home?
cp? rsync? dd?
Any suggestions for the best (eventually fastest but I would prefer most reliable) solution?
rsync.
From my backup script incantation:
DESTINO=/path/to/destination ORIGEN=/path/to/source/
OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable "
If the source is mounted and you make a second run:
OPTIONS="--archive --acls --xattrs --hard-links --sparse --stats --human-readable --del"
rsync $OPTIONS \
--relative --include=/data/vmware** --include=/data/storage_**
--include=/data/cripta** --include=/data/xtr** --include=/data/raid** \ --exclude=/lost+found --exclude=/dev --exclude=/sys --exclude=/proc --exclude=/run \ --exclude=/data/** --exclude=/mnt --exclude=/other --exclude=/media --exclude=/var/lib/samba/lock/ --exclude=/var/run/ \ $ORIGEN $DESTINO
Notice that destination misses the end slash, but not the source. You have to remove out the options you don't need, but I left them as examples. I think you may need just this:
rsync $OPTIONS \
/oldhome/ /newhome
-- Cheers,
Carlos E. R. (from openSUSE 15.4 x86_64 at Telcontar)
I finally did: rsync avxHAX --progress2 /home/ /transfer
currently running.
progress2 is a typo means rsync avxHAX --progress /home/ /transfer
participants (6)
-
Carlos E. R.
-
David C. Rankin
-
David T-G
-
Lew Wolfgang
-
Per Jessen
-
Stakanov