Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #248052

Re: Copying one drive to a smaller one.

From The Wanderer <wanderer@fastmail.fm>
Newsgroups linux.debian.user
Subject Re: Copying one drive to a smaller one.
Date 2022-05-09 23:00 +0200
Message-ID <EliE2-eoF4-3@gated-at.bofh.it> (permalink)
References <El0QN-ed6f-3@gated-at.bofh.it> <ElgLT-enyM-15@gated-at.bofh.it> <Elh5f-enUh-7@gated-at.bofh.it>
Organization This space intentionally left blank.

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 2022-05-09 at 15:18, Andrew M.A. Cater wrote:

> On Mon, May 09, 2022 at 11:54:16AM -0700, David Christensen wrote:

>> I would take the KISS approach -- backup the system configuration
>> files and data, remove the 500 GB drive, install the 250 GB drive,
>> do a fresh install onto the 250 GB drive, and reconfigure/
>> restore.
> 
> I also agree: then all you have to do is copy across data you wish to
> retain.
> 
> Alternatively, you can plug in the new drive and do a minimal install
> on it. Use
> 
> dpkg --get-selections > somefilename
> 
> to get a list of packages installed on one system and write it into
> somefile.
> 
> dpkg --set-selections < somefilename
> 
> will write that list for Debian's most basic package manager.

I've found that this doesn't always produce the desired result in some
cases. The most obvious one is when the names of the available packages
have changed between the two steps (e.g. a new kernel package), but
there are other times that issues can arise.

What I've found to be the method that produces the best results is use
the output of apt-mark instead:

oldmachine:~$ apt-mark showmanual > somefilename

newmachine:~# apt-get update

newmachine:~# apt-get install $(cat somefilename)

(I've tried various methods to get the install to work without the
subshell and the cat, but none of them seemed to put the package names
on the actual command line where apt-get could see them.)

That both installs the packages, and marks *only* the specified list of
packages as manually installed.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Copying one drive to a smaller one. <paulf@quillandmouse.com> - 2022-05-09 04:00 +0200
  Re: Copying one drive to a smaller one. Felix Miata <mrmazda@earthlink.net> - 2022-05-09 04:40 +0200
  Re: Copying one drive to a smaller one. David Christensen <dpchrist@holgerdanske.com> - 2022-05-09 21:00 +0200
    Re: Copying one drive to a smaller one. "Andrew M.A. Cater" <amacater@einval.com> - 2022-05-09 21:20 +0200
      Re: Copying one drive to a smaller one. Tixy <tixy@yxit.co.uk> - 2022-05-09 22:10 +0200
      Re: Copying one drive to a smaller one. The Wanderer <wanderer@fastmail.fm> - 2022-05-09 23:00 +0200
    Re: Copying one drive to a smaller one. <paulf@quillandmouse.com> - 2022-05-09 23:10 +0200
      Re: Copying one drive to a smaller one. Michael Stone <mstone@debian.org> - 2022-05-10 00:10 +0200
        Re: Copying one drive to a smaller one. Stefan Monnier <monnier@iro.umontreal.ca> - 2022-05-10 04:40 +0200
    Re: Copying one drive to a smaller one. "stepore@gmail.com" <stepore@gmail.com> - 2022-05-10 07:10 +0200
    Re: Copying one drive to a smaller one. <paulf@quillandmouse.com> - 2022-05-10 14:40 +0200
      Re: Copying one drive to a smaller one. Michael Stone <mstone@debian.org> - 2022-05-10 18:30 +0200
      Re: Copying one drive to a smaller one. Michael Stone <mstone@debian.org> - 2022-05-10 21:20 +0200
      Re: Copying one drive to a smaller one. <paulf@quillandmouse.com> - 2022-05-10 21:30 +0200

csiph-web