* [gentoo-user] duplicate gentoo system @ 2020-11-17 17:47 thelma 2020-11-17 18:26 ` Michael 2020-11-19 12:00 ` john vera 0 siblings, 2 replies; 12+ messages in thread From: thelma @ 2020-11-17 17:47 UTC (permalink / raw To: Gentoo mailing list I'm looking for an idea to duplicate my old gentoo system. I'm using old programs that require older version php, ( PHP Version 5.6) the program is not compatible with newer php. 7.4 and apache 2.2 Gentoo is install on 1TB SSD (/dev/sda) The new 2TB SSD is M.2 (so it has a strange name) 1.) Is my option only: dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync If I duplicate the drive this way I'll end-up with two partitions, as I'll have 1TB free on a new drive. Or is there a way to resize partition on M.2 SSD 2.) Another options, I could dig-out the old programs from "attic", but that will not be an easy job. -- Thelma ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-17 17:47 [gentoo-user] duplicate gentoo system thelma @ 2020-11-17 18:26 ` Michael 2020-11-17 18:36 ` thelma 2020-11-18 6:46 ` thelma 2020-11-19 12:00 ` john vera 1 sibling, 2 replies; 12+ messages in thread From: Michael @ 2020-11-17 18:26 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1529 bytes --] On Tuesday, 17 November 2020 17:47:09 GMT thelma@sys-concept.com wrote: > I'm looking for an idea to duplicate my old gentoo system. > I'm using old programs that require older version php, ( PHP Version > 5.6) the program is not compatible with newer php. 7.4 and apache 2.2 > > Gentoo is install on 1TB SSD (/dev/sda) > The new 2TB SSD is M.2 (so it has a strange name) > > 1.) Is my option only: > dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync > > If I duplicate the drive this way I'll end-up with two partitions, as > I'll have 1TB free on a new drive. Or is there a way to resize > partition on M.2 SSD > > 2.) Another options, I could dig-out the old programs from "attic", but > that will not be an easy job. You could go about this in a number of different ways. dd command will take forever, as it is copying every bit and byte from one disk to the next, whether it contains data or not. I prefer to use a clonezilla liveUSB to copy a disk or selected partitions between disks, which will take significantly less time as only blocks with data get copied over. You can increase the partition size after you finish copying it onto the new disk and then the filesystem size within it. Gparted can run both steps in a single stroke. If you prefer a more manual and tedious way, you can create a partition as large as you need it to be on the new disk, format it with a filesystem of choice, then use rsync or tar to copy over the files you want and --exclude anything you don't want copied over. [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-17 18:26 ` Michael @ 2020-11-17 18:36 ` thelma 2020-11-18 6:46 ` thelma 1 sibling, 0 replies; 12+ messages in thread From: thelma @ 2020-11-17 18:36 UTC (permalink / raw To: gentoo-user On 11/17/2020 11:26 AM, Michael wrote: > On Tuesday, 17 November 2020 17:47:09 GMT thelma@sys-concept.com wrote: >> I'm looking for an idea to duplicate my old gentoo system. >> I'm using old programs that require older version php, ( PHP Version >> 5.6) the program is not compatible with newer php. 7.4 and apache 2.2 >> >> Gentoo is install on 1TB SSD (/dev/sda) >> The new 2TB SSD is M.2 (so it has a strange name) >> >> 1.) Is my option only: >> dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync >> >> If I duplicate the drive this way I'll end-up with two partitions, as >> I'll have 1TB free on a new drive. Or is there a way to resize >> partition on M.2 SSD >> >> 2.) Another options, I could dig-out the old programs from "attic", but >> that will not be an easy job. > > You could go about this in a number of different ways. > > dd command will take forever, as it is copying every bit and byte from one > disk to the next, whether it contains data or not. > > I prefer to use a clonezilla liveUSB to copy a disk or selected partitions > between disks, which will take significantly less time as only blocks with > data get copied over. > > You can increase the partition size after you finish copying it onto the new > disk and then the filesystem size within it. Gparted can run both steps in a > single stroke. > > If you prefer a more manual and tedious way, you can create a partition as > large as you need it to be on the new disk, format it with a filesystem of > choice, then use rsync or tar to copy over the files you want and --exclude > anything you don't want copied over. Thanks for the input, will try on the weekend. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-17 18:26 ` Michael 2020-11-17 18:36 ` thelma @ 2020-11-18 6:46 ` thelma 2020-11-18 8:00 ` Thomas Mueller ` (2 more replies) 1 sibling, 3 replies; 12+ messages in thread From: thelma @ 2020-11-18 6:46 UTC (permalink / raw To: gentoo-user On 11/17/2020 11:26 AM, Michael wrote: > On Tuesday, 17 November 2020 17:47:09 GMT thelma@sys-concept.com wrote: >> I'm looking for an idea to duplicate my old gentoo system. >> I'm using old programs that require older version php, ( PHP Version >> 5.6) the program is not compatible with newer php. 7.4 and apache 2.2 >> >> Gentoo is install on 1TB SSD (/dev/sda) >> The new 2TB SSD is M.2 (so it has a strange name) >> >> 1.) Is my option only: >> dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync >> >> If I duplicate the drive this way I'll end-up with two partitions, as >> I'll have 1TB free on a new drive. Or is there a way to resize >> partition on M.2 SSD >> >> 2.) Another options, I could dig-out the old programs from "attic", but >> that will not be an easy job. > > You could go about this in a number of different ways. > > dd command will take forever, as it is copying every bit and byte from one > disk to the next, whether it contains data or not. > > I prefer to use a clonezilla liveUSB to copy a disk or selected partitions > between disks, which will take significantly less time as only blocks with > data get copied over. > > You can increase the partition size after you finish copying it onto the new > disk and then the filesystem size within it. Gparted can run both steps in a > single stroke. > > If you prefer a more manual and tedious way, you can create a partition as > large as you need it to be on the new disk, format it with a filesystem of > choice, then use rsync or tar to copy over the files you want and --exclude > anything you don't want copied over. Manual approach might be confusing and prone to errors. I will try Gparted as you suggested but I was wondering if it will allow me to combine/join partitions. On most modern system I think there is: 1 - boot partiton 2 - swap if needed 3 - root partition (where home is as well) My current layout is old one: dev/sda1 /boot ext2 /dev/sda3 / ext4 /dev/sda2 none swap /dev/sda4 /home ext4 Is it possible with Gparted combine "/" and "home" partitions, or is it as simple as coping all file from "home" partition to "/" home folder. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-18 6:46 ` thelma @ 2020-11-18 8:00 ` Thomas Mueller 2020-11-18 8:49 ` Dale 2020-11-18 11:22 ` Michael 2 siblings, 0 replies; 12+ messages in thread From: Thomas Mueller @ 2020-11-18 8:00 UTC (permalink / raw To: gentoo-user from thelma@sys-concept.com: > Manual approach might be confusing and prone to errors. > I will try Gparted as you suggested but I was wondering if it will allow > me to combine/join partitions. On most modern system I think there is: > 1 - boot partiton > 2 - swap if needed > 3 - root partition (where home is as well) > My current layout is old one: > dev/sda1 /boot ext2 > /dev/sda3 / ext4 > /dev/sda2 none swap > /dev/sda4 /home ext4 > Is it possible with Gparted combine "/" and "home" partitions, or is it > as simple as coping all file from "home" partition to "/" home folder. I never used parted or gparted, but prefer to put "home" in a different partition. That way, if you mess up or otherwise have to reformat the root partition, home is unaffected. Also, you can access the same home partition from more than one OS installation that can read/write the file system, in this case ext2 or ext4. Tom ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-18 6:46 ` thelma 2020-11-18 8:00 ` Thomas Mueller @ 2020-11-18 8:49 ` Dale 2020-11-18 9:01 ` Neil Bothwick 2020-11-18 11:22 ` Michael 2 siblings, 1 reply; 12+ messages in thread From: Dale @ 2020-11-18 8:49 UTC (permalink / raw To: gentoo-user thelma@sys-concept.com wrote: > or is it > as simple as coping all file from "home" partition to "/" home folder. > That's what I would do. First, umount /home. Mount /home somewhere else like /mnt/tmp or something. Copy everything from /mnt/tmp to /home. Make sure to remove any entries in fstab for /home too. Then umount /mnt/tmp and carry on. I don't think I'm missing anything. I'm with Thomas tho, I've always kept /home on a separate partition. It has made things easier when I have to reinstall, lose a drive etc etc. Things happen and having eggs in separate baskets can help. That said, if it will work best for your needs or circumstances or both, then it is what it is. Hope that helps. Dale :-) :-) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-18 8:49 ` Dale @ 2020-11-18 9:01 ` Neil Bothwick 2020-11-18 9:12 ` Dale 0 siblings, 1 reply; 12+ messages in thread From: Neil Bothwick @ 2020-11-18 9:01 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1240 bytes --] On Wed, 18 Nov 2020 02:49:10 -0600, Dale wrote: > thelma@sys-concept.com wrote: > > or is it > > as simple as coping all file from "home" partition to "/" home folder. > > > > > That's what I would do. First, umount /home. Mount /home somewhere > else like /mnt/tmp or something. Copy everything from /mnt/tmp to > /home. Make sure to remove any entries in fstab for /home too. Then > umount /mnt/tmp and carry on. I don't think I'm missing anything. Or you can bind mount / somewhere and copy /home to home on the bind mount, saves unmounting anything. mount --bind / /mnt/tmp rsync -a /home/ /mnt/tmp/home/ > I'm with Thomas tho, I've always kept /home on a separate partition. It > has made things easier when I have to reinstall, lose a drive etc etc. > Things happen and having eggs in separate baskets can help. That said, > if it will work best for your needs or circumstances or both, then it is > what it is. Agreed, it also helps with backing up you are likely to have different requirements for backing up the OS, which is replaceable, and your data, which isn't. -- Neil Bothwick First Law of Laboratory Work: Hot glass looks exactly the same as cold glass. [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-18 9:01 ` Neil Bothwick @ 2020-11-18 9:12 ` Dale 0 siblings, 0 replies; 12+ messages in thread From: Dale @ 2020-11-18 9:12 UTC (permalink / raw To: gentoo-user Neil Bothwick wrote: > On Wed, 18 Nov 2020 02:49:10 -0600, Dale wrote: > >> thelma@sys-concept.com wrote: >>> or is it >>> as simple as coping all file from "home" partition to "/" home folder. >>> >> That's what I would do. First, umount /home. Mount /home somewhere >> else like /mnt/tmp or something. Copy everything from /mnt/tmp to >> /home. Make sure to remove any entries in fstab for /home too. Then >> umount /mnt/tmp and carry on. I don't think I'm missing anything. > Or you can bind mount / somewhere and copy /home to home on the bind > mount, saves unmounting anything. > > mount --bind / /mnt/tmp > rsync -a /home/ /mnt/tmp/home/ > True. I'm not to familiar with bind mounting, unless I copy and paste from a wiki or something. Would be easier tho. ;-) >> I'm with Thomas tho, I've always kept /home on a separate partition. It >> has made things easier when I have to reinstall, lose a drive etc etc. >> Things happen and having eggs in separate baskets can help. That said, >> if it will work best for your needs or circumstances or both, then it is >> what it is. > Agreed, it also helps with backing up you are likely to have different > requirements for backing up the OS, which is replaceable, and your data, > which isn't. > > > -- Neil Bothwick First Law of Laboratory Work: Hot glass looks exactly > the same as cold glass. I like your sigs. Sometimes they have me rolling. ROFL Dale :-) :-) ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-18 6:46 ` thelma 2020-11-18 8:00 ` Thomas Mueller 2020-11-18 8:49 ` Dale @ 2020-11-18 11:22 ` Michael 2020-11-18 19:16 ` antlists 2 siblings, 1 reply; 12+ messages in thread From: Michael @ 2020-11-18 11:22 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 4248 bytes --] On Wednesday, 18 November 2020 06:46:35 GMT thelma@sys-concept.com wrote: > On 11/17/2020 11:26 AM, Michael wrote: > > On Tuesday, 17 November 2020 17:47:09 GMT thelma@sys-concept.com wrote: > >> I'm looking for an idea to duplicate my old gentoo system. > >> I'm using old programs that require older version php, ( PHP Version > >> 5.6) the program is not compatible with newer php. 7.4 and apache 2.2 > >> > >> Gentoo is install on 1TB SSD (/dev/sda) > >> The new 2TB SSD is M.2 (so it has a strange name) > >> > >> 1.) Is my option only: > >> dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync > >> > >> If I duplicate the drive this way I'll end-up with two partitions, as > >> I'll have 1TB free on a new drive. Or is there a way to resize > >> partition on M.2 SSD > >> > >> 2.) Another options, I could dig-out the old programs from "attic", but > >> that will not be an easy job. > > > > You could go about this in a number of different ways. > > > > dd command will take forever, as it is copying every bit and byte from one > > disk to the next, whether it contains data or not. > > > > I prefer to use a clonezilla liveUSB to copy a disk or selected partitions > > between disks, which will take significantly less time as only blocks with > > data get copied over. > > > > You can increase the partition size after you finish copying it onto the > > new disk and then the filesystem size within it. Gparted can run both > > steps in a single stroke. > > > > If you prefer a more manual and tedious way, you can create a partition as > > large as you need it to be on the new disk, format it with a filesystem of > > choice, then use rsync or tar to copy over the files you want and > > --exclude > > anything you don't want copied over. > > Manual approach might be confusing and prone to errors. > I will try Gparted as you suggested but I was wondering if it will allow > me to combine/join partitions. On most modern system I think there is: > 1 - boot partiton > 2 - swap if needed > 3 - root partition (where home is as well) > > My current layout is old one: > dev/sda1 /boot ext2 > /dev/sda3 / ext4 > /dev/sda2 none swap > /dev/sda4 /home ext4 > > Is it possible with Gparted combine "/" and "home" partitions, or is it > as simple as coping all file from "home" partition to "/" home folder. Others have answered this already and I agree with them, a separate /home partition is better for longer term OS maintenance/back up/replacement, without messing up with your personal data in /home. However, if you really want to have your /home directory on the same partition as / then a step by step approach could be: 1. Use Gparted to create /boot[1], / and swap partitions of the desired size. Use up the whole 2TB of the new disk if you want, or make each partition to any size you like, as long as each partition on the new disk is at least as large as the corresponding partition on the old disk. You can use LVM if you want to have resizable logical volumes on the new disk. 2. Use Clonezilla LiveCD/USB to clone /boot and / partitions from the old to the new disk. If the new partitions are larger in size compared to the old partitions, use Gparted (or CLI tools like resize2fs) after you finish cloning the partition data to resize the filesystem and fill up the new partitions. Create the new swap (mkswap and swapon). 3. Then mount your /home partition on the old disk and the / partition on the new disk and use 'rsync -axAHX' or tar (don't forget --xattrs) to copy over the /home directory from the old to the new. 4. Adjust the new /etc/fstab accordingly.[2] 5. Reboot using the new disk to check all is as it should be. [1] You may not want/need a new /boot partition - the old /boot in /dev/sda1 will be able to also boot the cloned / partition, but you would need to adjust/update your boot manager to include the new / partition. [2] Clonezilla will copy over the original partition UUID so you will need to check this with blkid and change it with tune2fs to avoid clashes if both disks will be on the same PC. I hope I haven't missed up anything in the above, since it's not something I do often, but troubleshooting omissions should be easy to resolve. [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-18 11:22 ` Michael @ 2020-11-18 19:16 ` antlists 2020-11-18 19:46 ` Michael 0 siblings, 1 reply; 12+ messages in thread From: antlists @ 2020-11-18 19:16 UTC (permalink / raw To: gentoo-user On 18/11/2020 11:22, Michael wrote: > However, if you really want to have your /home directory on the same partition > as / then a step by step approach could be: One big problem with /home on / is that a rogue luser can DoS your system by filling the disk. Same reason you should keep /var on a different partition - you don't want logs filling the partition because you got your rotate wrong ... Cheers, Wol ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-18 19:16 ` antlists @ 2020-11-18 19:46 ` Michael 0 siblings, 0 replies; 12+ messages in thread From: Michael @ 2020-11-18 19:46 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 904 bytes --] On Wednesday, 18 November 2020 19:16:55 GMT antlists wrote: > On 18/11/2020 11:22, Michael wrote: > > However, if you really want to have your /home directory on the same > > partition > > as / then a step by step approach could be: > One big problem with /home on / is that a rogue luser can DoS your > system by filling the disk. Same reason you should keep /var on a > different partition - you don't want logs filling the partition because > you got your rotate wrong ... > > Cheers, > Wol I usually leave the /home and /boot directories on / for VM systems, which I use only for testing. I have no personal data on these systems and only use them to test OS or apps and particular configurations with them. On installations which I use on personal laptops/desktops I always have /var, / home, /boot on separate partitions for good reasons already mentioned. However, each to their own. :-) [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] duplicate gentoo system 2020-11-17 17:47 [gentoo-user] duplicate gentoo system thelma 2020-11-17 18:26 ` Michael @ 2020-11-19 12:00 ` john vera 1 sibling, 0 replies; 12+ messages in thread From: john vera @ 2020-11-19 12:00 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 781 bytes --] John_ El mar., 17 nov. 2020 a las 18:47, <thelma@sys-concept.com> escribió: > I'm looking for an idea to duplicate my old gentoo system. > I'm using old programs that require older version php, ( PHP Version > 5.6) the program is not compatible with newer php. 7.4 and apache 2.2 > > Gentoo is install on 1TB SSD (/dev/sda) > The new 2TB SSD is M.2 (so it has a strange name) > > 1.) Is my option only: > dd if=/dev/sdX of=/dev/sdY bs=64K conv=noerror,sync > > If I duplicate the drive this way I'll end-up with two partitions, as > I'll have 1TB free on a new drive. Or is there a way to resize > partition on M.2 SSD > > 2.) Another options, I could dig-out the old programs from "attic", but > that will not be an easy job. > > -- > Thelma > > [-- Attachment #2: Type: text/html, Size: 1357 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-11-19 12:01 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-11-17 17:47 [gentoo-user] duplicate gentoo system thelma 2020-11-17 18:26 ` Michael 2020-11-17 18:36 ` thelma 2020-11-18 6:46 ` thelma 2020-11-18 8:00 ` Thomas Mueller 2020-11-18 8:49 ` Dale 2020-11-18 9:01 ` Neil Bothwick 2020-11-18 9:12 ` Dale 2020-11-18 11:22 ` Michael 2020-11-18 19:16 ` antlists 2020-11-18 19:46 ` Michael 2020-11-19 12:00 ` john vera
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox