Re: Near clones of a Debian install
On 7/23/2016 2:16 AM, Richard Owlett wrote: On 7/22/2016 2:55 PM, Pascal Hambourg wrote: [snip] Quite. I have cloned a root partition on the same disk in order to do some experiments on the cloned system. I think I just changed the UUID and label in the filesystem metadata and in /etc/fstab. Something like that was in the back of my mind when writing "almost clone". I just didn't know what needed to be tweaked. I think that is the route I'll follow. I has the advantage of causing to investigate "how to change a UUID". I found out how but what was most beneficial was side roads leading to a better understanding of the guts of Linux. LVM2 and ZFS had been suggested. Reading about them did give me ideas about one of my other possible future projects.
Re: Near clones of a Debian install
On 7/22/2016 6:23 PM, Dan Ritter wrote: On Fri, Jul 22, 2016 at 11:04:23AM -0500, Richard Owlett wrote: I have a laptop set aside for experimenting with Debian installs. I've not yet defined my personal "optimal" install. My nominally base install will be a reasonably standard CLI plus a personally preferred default set of utilities. That base install *SHALL BE* on a read-only partition (e.g. sda5). I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). The above "almost" refers to whatever is required to run Debian as installed to that *explicit* partition. I will make various install/configuration choices to the "almost cloned" partitions. My then current "optimal" install will then be placed on either sda5 or sda 6 as I consider appropriate. Does that make sense? I can think of two ways of doing this. One involves VMs, which you said you don't like. The other involves ZFS. Install ZFS-on-Linux, use it as your root. Snapshot the root. Clone it X times. Change the clones. -dsr- I'm not familiar with ZFS. I will have to do some reading.
Re: Near clones of a Debian install
On 7/22/2016 4:57 PM, Pascal Hambourg wrote: Le 22/07/2016 à 23:21, Pascal Hambourg a écrit : Can you write into a snapshot ? I assumed that a snapshot was just an immutable image of the original volume taken at a given moment. Never mind, I just found out that LVM2 snapshots are read/write. Thanks for the tip. I'm wonder if "snapshot" might be what I really want rather than "read only". I see some reading in my future. Thank you Stefan and Pascal.
Re: Near clones of a Debian install
On 7/22/2016 1:12 PM, rhkra...@gmail.com wrote: On Friday, July 22, 2016 01:41:01 PM Pascal Hambourg wrote: Le 22/07/2016 à 18:04, Richard Owlett a écrit : That base install *SHALL BE* on a read-only partition (e.g. sda5). I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). (...) Does that make sense? Not really. 1) You cannot install on a read-only partition. 2) It does not make sense to clone to sda5 something which is already on sda5. I'm tempted to attempt to amplify or clarify Pascal's response, but I'm not sure I remember enough to do so. Iirc, a Linux installation needs some place to write some information, and thus, unless you make some sort of special provision (as is done, iiuc, for at least some pendrive installations), you will have problems running Linux. Again, iirc, some of those pendrive installations load everything they use into a RAM drive image and run the software from there. You could do the same. Some other pendrive installations do things like write what they need to write to a writable partition on the harddrive (hopefully, after asking for a location and permission from the user), or to some portion of the pendrive, or to a temporarily created RAM disk. My response is (I'm sure), not 100% accurate in the details, but I hope it gives you some clues to pursue further. I did not intend to run from the "read only" partition. Its purpose is to be a "safe" image of my starting enviroment for my experments.
Re: Near clones of a Debian install
On 7/22/2016 2:55 PM, Pascal Hambourg wrote: Le 22/07/2016 à 20:07, Richard Owlett a écrit : The partition will be marked "read only" *AFTER* install. May I ask how you intend to do this ? AFAIK, there is no persistent way to mark a partition or filesystem read-only. GPT partition table entries have a read-only flag but it seems to be ignored. An ext2/3/4 filesystem can be mounted read-only, but this is only a mount-time option. tune2fs does not provide any option to mount it read-only permanently. A block device can be set read-only with the following command : blockdev --setro /dev/ but this is not persistent either and must be done at each boot by an initscript, systemd service or udev rule. Forewarned is forearmed ;/ Just learned something more about Linux. I'll make another copy on removable media and then remove it. *TYPO* I wish to "almost clone" sda5 to [sda6, sda7, sda8]. I had figured out, but wanted to be sure there was no misunderstanding. I hope that makes more sense. Quite. I have cloned a root partition on the same disk in order to do some experiments on the cloned system. I think I just changed the UUID and label in the filesystem metadata and in /etc/fstab. Something like that was in the back of my mind when writing "almost clone". I just didn't know what needed to be tweaked.
Re: Near clones of a Debian install
On Fri, Jul 22, 2016 at 11:04:23AM -0500, Richard Owlett wrote: > I have a laptop set aside for experimenting with Debian installs. > I've not yet defined my personal "optimal" install. > My nominally base install will be a reasonably standard CLI plus a > personally preferred default set of utilities. > > That base install *SHALL BE* on a read-only partition (e.g. sda5). > I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). > The above "almost" refers to whatever is required to run Debian as installed > to that *explicit* partition. > I will make various install/configuration choices to the "almost cloned" > partitions. > My then current "optimal" install will then be placed on either sda5 or sda > 6 as I consider appropriate. > > Does that make sense? I can think of two ways of doing this. One involves VMs, which you said you don't like. The other involves ZFS. Install ZFS-on-Linux, use it as your root. Snapshot the root. Clone it X times. Change the clones. -dsr-
Re: Near clones of a Debian install
Le 22/07/2016 à 23:21, Pascal Hambourg a écrit : Can you write into a snapshot ? I assumed that a snapshot was just an immutable image of the original volume taken at a given moment. Never mind, I just found out that LVM2 snapshots are read/write. Thanks for the tip.
Re: Near clones of a Debian install
Le 22/07/2016 à 22:22, Stefan Monnier a écrit : Use LVM, of course (and you can use LVM snapshots to speed up the cloning). Sounds like a nice idea, but how do you use snapshots to clone a logical volume and then use the clone as a regular volume ? Not sure what you mean by "regular volume". All my "partitions" are logical volumes and when I create a snapshot I just get another "logical volume". Can you write into a snapshot ? I assumed that a snapshot was just an immutable image of the original volume taken at a given moment.
Re: Near clones of a Debian install
>> Use LVM, of course (and you can use LVM snapshots to speed up the >> cloning). > Sounds like a nice idea, but how do you use snapshots to clone a logical > volume and then use the clone as a regular volume ? Not sure what you mean by "regular volume". All my "partitions" are logical volumes and when I create a snapshot I just get another "logical volume". Stefan
Re: Near clones of a Debian install
Le 22/07/2016 à 20:29, Stefan Monnier a écrit : Use LVM, of course (and you can use LVM snapshots to speed up the cloning). Sounds like a nice idea, but how do you use snapshots to clone a logical volume and then use the clone as a regular volume ?
Re: Near clones of a Debian install
Le 22/07/2016 à 20:07, Richard Owlett a écrit : The partition will be marked "read only" *AFTER* install. May I ask how you intend to do this ? AFAIK, there is no persistent way to mark a partition or filesystem read-only. GPT partition table entries have a read-only flag but it seems to be ignored. An ext2/3/4 filesystem can be mounted read-only, but this is only a mount-time option. tune2fs does not provide any option to mount it read-only permanently. A block device can be set read-only with the following command : blockdev --setro /dev/ but this is not persistent either and must be done at each boot by an initscript, systemd service or udev rule. *TYPO* I wish to "almost clone" sda5 to [sda6, sda7, sda8]. I had figured out, but wanted to be sure there was no misunderstanding. I hope that makes more sense. Quite. I have cloned a root partition on the same disk in order to do some experiments on the cloned system. I think I just changed the UUID and label in the filesystem metadata and in /etc/fstab.
Re: Near clones of a Debian install
> The above "almost" refers to whatever is required to run Debian as installed > to that *explicit* partition. Maybe systemd is a bit more picky, but at least in the past, the root partition did not need to be present in /etc/fstab, so in many cases there was no need to do anything at all when moving the root partition elsewhere (other than tell the boot-loader, of course, but that shouldn't be an issue in your case). > Does that make sense? More or less. > Suggestions and polite brick-brats accepted ;/ Use LVM, of course (and you can use LVM snapshots to speed up the cloning). Other than that, not sure what's the question. Stefan
Re: Near clones of a Debian install
First I wish to say "Thank you!". Second I wish to say *ROFL* ;/ I have a suitably large hard disk. I have a suitable preseed.cfg file. I have used said preseed.cfg to produce required installs. Each ~"clone" takes too long ;/ For _idiosyncratic_ reasons I will *NOT* accept a VM. My default set of utilities is explicitly irrelevant. lol I've spent *DECADES* in engineering support. My spec may not seem ""/"whatever". *HOWEVER* it is my specification. P.S. Friends/relatives think I'm "___". {fill in choice adjective] *THANK YOU* for responding. On 7/22/2016 12:31 PM, Andrew M.A. Cater wrote: On Fri, Jul 22, 2016 at 11:04:23AM -0500, Richard Owlett wrote: I have a laptop set aside for experimenting with Debian installs. I've not yet defined my personal "optimal" install. My nominally base install will be a reasonably standard CLI plus a personally preferred default set of utilities. That base install *SHALL BE* on a read-only partition (e.g. sda5). I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). The above "almost" refers to whatever is required to run Debian as installed to that *explicit* partition. I will make various install/configuration choices to the "almost cloned" partitions. My then current "optimal" install will then be placed on either sda5 or sda 6 as I consider appropriate. Does that make sense? Suggestions and polite brick-brats accepted ;/ TIA Get a largish hard disk - if your machine is able to run virtualisation and KVM - build virtual machines and do this sort of thing in those. Or - use preseed and PXE boot to do this install multiple times. What's the default set of utilities? All the best, AndyC
Re: Near clones of a Debian install
On Friday, July 22, 2016 01:41:01 PM Pascal Hambourg wrote: > Le 22/07/2016 à 18:04, Richard Owlett a écrit : > > That base install *SHALL BE* on a read-only partition (e.g. sda5). > > I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). > > (...) > > > Does that make sense? > > Not really. > 1) You cannot install on a read-only partition. > 2) It does not make sense to clone to sda5 something which is already on > sda5. I'm tempted to attempt to amplify or clarify Pascal's response, but I'm not sure I remember enough to do so. Iirc, a Linux installation needs some place to write some information, and thus, unless you make some sort of special provision (as is done, iiuc, for at least some pendrive installations), you will have problems running Linux. Again, iirc, some of those pendrive installations load everything they use into a RAM drive image and run the software from there. You could do the same. Some other pendrive installations do things like write what they need to write to a writable partition on the harddrive (hopefully, after asking for a location and permission from the user), or to some portion of the pendrive, or to a temporarily created RAM disk. My response is (I'm sure), not 100% accurate in the details, but I hope it gives you some clues to pursue further.
Re: Near clones of a Debian install
On 7/22/2016 12:41 PM, Pascal Hambourg wrote: Le 22/07/2016 à 18:04, Richard Owlett a écrit : That base install *SHALL BE* on a read-only partition (e.g. sda5). I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). (...) Does that make sense? Not really. 1) You cannot install on a read-only partition. The partition will be marked "read only" *AFTER* install. 2) It does not make sense to clone to sda5 something which is already on sda5. *TYPO* I wish to "almost clone" sda5 to [sda6, sda7, sda8]. I hope that makes more sense.
Re: Near clones of a Debian install
Le 22/07/2016 à 18:04, Richard Owlett a écrit : That base install *SHALL BE* on a read-only partition (e.g. sda5). I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). (...) Does that make sense? Not really. 1) You cannot install on a read-only partition. 2) It does not make sense to clone to sda5 something which is already on sda5.
Re: Near clones of a Debian install
What is your goal? What are you trying to achieve--just experimenting? On Friday, July 22, 2016 12:04:23 PM Richard Owlett wrote: > I have a laptop set aside for experimenting with Debian installs. > I've not yet defined my personal "optimal" install. > My nominally base install will be a reasonably standard CLI plus > a personally preferred default set of utilities. > > That base install *SHALL BE* on a read-only partition (e.g. sda5). > I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). > The above "almost" refers to whatever is required to run Debian > as installed to that *explicit* partition. > I will make various install/configuration choices to the "almost > cloned" partitions. > My then current "optimal" install will then be placed on either > sda5 or sda 6 as I consider appropriate. > > Does that make sense? > Suggestions and polite brick-brats accepted ;/ > TIA
Near clones of a Debian install
I have a laptop set aside for experimenting with Debian installs. I've not yet defined my personal "optimal" install. My nominally base install will be a reasonably standard CLI plus a personally preferred default set of utilities. That base install *SHALL BE* on a read-only partition (e.g. sda5). I wish to "almost clone" it to sda5, (e.g. sda6, sda7, sda8). The above "almost" refers to whatever is required to run Debian as installed to that *explicit* partition. I will make various install/configuration choices to the "almost cloned" partitions. My then current "optimal" install will then be placed on either sda5 or sda 6 as I consider appropriate. Does that make sense? Suggestions and polite brick-brats accepted ;/ TIA