• Backing up my HD (prior to installation of new OS)

    From Daniel70@daniel47@nomail.afraid.org to alt.os.linux.mageia on Fri Jan 10 21:25:36 2025
    From Newsgroup: alt.os.linux.mageia

    Prior to installing MGA9 (which, eventually, I'd then upgrade to MGA10),
    my HD looks like ....

    [root@localhost daniel]# lsblk -o NAME,FSTYPE,MOUNTPOINT,LABEL,SIZE
    NAME FSTYPE MOUNTPOINT LABEL SIZE
    sr0 1024M
    sda 465.8G
    roLroCsda4 1K
    roLroCsda2 ntfs /media/win_d Programs 19.5G
    roLroCsda12 ext4 24.4G
    roLroCsda9 ext3 / 10.1G
    roLroCsda10 ext3 /MGA4 10.7G
    roLroCsda7 ext3 /MGA3 7.8G
    roLroCsda5 swap [SWAP] 3.9G
    roLroCsda3 ntfs /media/win_e Games 22.5G
    roLroCsda1 ntfs /media/win_c C:\ 60.1G
    roLroCsda13 ext4 / 48.9G
    roLroCsda11 ext4 24.4G
    roLroCsda8 ext4 /home 223.1G
    rooroCsda6 ext3 /MDA2009 10.4G
    [root@localhost daniel]#

    I want to back-up my 500GB Internal HD to a 2TB External HD. Previously
    (i.e. at about the time I installed MGA6), I used a single 'dd' command
    to copy the entire 500GB to the ext drive (including the 4GB SWAP
    Partition) back some time ago.

    Reading up yesterday (which, of course, I can't locate tonight), which
    ever web sight it was gave me the impression I could use the 'dd'
    command to back-up partition one at a time .... but, on that web-page,
    the back-up was onto the same, internal, hard-drive.

    To save me backing up the (useless) Swap drive to my external
    Hard-drive, can I use 'dd' to back up, one partition at a time, to my
    External Hard-Drive??

    e,g, dd if sda1 of sdb/240120/Win7Sys/

    then

    dd if sda2 of sdb/240120/WinEXE/sdb2/240120/WinEXE/

    and

    dd if sda3 of sdb/240120/WinStuff/

    and

    dd if sda6 of sdb/240120/MDA2009

    and

    dd if sda10 of sdb/240120/MGA4

    etc ... etc ... etc??

    Or might there be a more suitable command to carry out my situation??
    --
    Daniel
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From David W. Hodgins@dwhodgins@nomail.afraid.org to alt.os.linux.mageia on Fri Jan 10 13:43:58 2025
    From Newsgroup: alt.os.linux.mageia

    On Fri, 10 Jan 2025 05:25:36 -0500, Daniel70 <daniel47@nomail.afraid.org> wrote:

    Prior to installing MGA9 (which, eventually, I'd then upgrade to MGA10),
    my HD looks like ....

    [root@localhost daniel]# lsblk -o NAME,FSTYPE,MOUNTPOINT,LABEL,SIZE
    NAME FSTYPE MOUNTPOINT LABEL SIZE
    sr0 1024M
    sda 465.8G
    roLroCsda4 1K
    roLroCsda2 ntfs /media/win_d Programs 19.5G
    roLroCsda12 ext4 24.4G
    roLroCsda9 ext3 / 10.1G
    roLroCsda10 ext3 /MGA4 10.7G
    roLroCsda7 ext3 /MGA3 7.8G
    roLroCsda5 swap [SWAP] 3.9G
    roLroCsda3 ntfs /media/win_e Games 22.5G
    roLroCsda1 ntfs /media/win_c C:\ 60.1G
    roLroCsda13 ext4 / 48.9G
    roLroCsda11 ext4 24.4G
    roLroCsda8 ext4 /home 223.1G
    rooroCsda6 ext3 /MDA2009 10.4G
    [root@localhost daniel]#

    I want to back-up my 500GB Internal HD to a 2TB External HD. Previously
    (i.e. at about the time I installed MGA6), I used a single 'dd' command
    to copy the entire 500GB to the ext drive (including the 4GB SWAP
    Partition) back some time ago.

    Reading up yesterday (which, of course, I can't locate tonight), which
    ever web sight it was gave me the impression I could use the 'dd'
    command to back-up partition one at a time .... but, on that web-page,
    the back-up was onto the same, internal, hard-drive.

    To save me backing up the (useless) Swap drive to my external
    Hard-drive, can I use 'dd' to back up, one partition at a time, to my External Hard-Drive??

    e,g, dd if sda1 of sdb/240120/Win7Sys/

    then

    dd if sda2 of sdb/240120/WinEXE/sdb2/240120/WinEXE/

    and

    dd if sda3 of sdb/240120/WinStuff/

    and

    dd if sda6 of sdb/240120/MDA2009

    and

    dd if sda10 of sdb/240120/MGA4

    etc ... etc ... etc??

    Or might there be a more suitable command to carry out my situation??

    The dd command works fine with individual partitions, provideded you are ok including free space
    in the backup. For example "dd if=/dev/sda1 of=/sdb/$PATHTOBACKUP/sda1.backup bs=1M".
    That puts a backup into a file, which you can compress if needed for the backup.

    If you want to copy it to a newly created partition on a new drive, the new partition must be
    created first, with exactly the same number of sectors, and then the contents copied
    For example, if the new partition has been created as /dev/sdc10, then to copy it from sda10,
    "dd if=/dev/sda10 of=/sdc10 bs=1M".

    Don't forget the bs=1M whenever copying anything larger than a sector (normally 512 bytes).

    My desktop system died recently. I'm currently using my laptop. For my backups I use rsync,
    to copy directories and the files only. No free space or swap in the backup, and only backed
    up /etc, /home, parts of /var, /root, and /usr/local.

    For the backup of each directory I used commands such as ...
    rsync -auvxSP --specials --delete --exclude="lost+found" /usr/local/ /s3/usr/local/
    That was with the usb backup partition mounted on /s3.

    For the restore to my laptop, I used ...
    rsync -auvxSP --specials --delete --exclude="lost+found" /run/media/dave/BACKUP/usr/local/ /usr/local/

    The --exclude="lost+found" isn't needed in this case. I leave it in as I just copy/paste the line
    and change the directories as needed.

    I normally run the rsync commands as root. Some of the uid/gid for the file owners are
    different, so I then use chown as needed.

    As my laptop already had stuff on it, I only restored what I needed from within some of the
    backup directories.

    Regards, Dave Hodgins
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Daniel70@daniel47@nomail.afraid.org to alt.os.linux.mageia on Sun Jan 12 19:29:29 2025
    From Newsgroup: alt.os.linux.mageia

    David W. Hodgins wrote on 11/01/2025 5:43 am:
    On Fri, 10 Jan 2025 05:25:36 -0500, Daniel70
    <daniel47@nomail.afraid.org> wrote:

    Prior to installing MGA9 (which, eventually, I'd then upgrade to MGA10),
    my HD looks like ....

    [root@localhost daniel]# lsblk -o NAME,FSTYPE,MOUNTPOINT,LABEL,SIZE
    NAME-a-a-a FSTYPE MOUNTPOINT-a-a LABEL-a-a-a-a-a SIZE
    sr0-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 1024M
    sda-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 465.8G >> roLroCsda4-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 1K
    roLroCsda2-a ntfs-a-a /media/win_d Programs-a 19.5G
    roLroCsda12 ext4-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 24.4G
    roLroCsda9-a ext3-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a /-a-a-a-a-a-a-a-a 10.1G
    roLroCsda10 ext3-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a /MGA4-a-a-a-a 10.7G
    roLroCsda7-a ext3-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a /MGA3-a-a-a-a-a 7.8G
    roLroCsda5-a swap-a-a [SWAP]-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 3.9G
    roLroCsda3-a ntfs-a-a /media/win_e Games-a-a-a-a 22.5G
    roLroCsda1-a ntfs-a-a /media/win_c C:\-a-a-a-a-a-a 60.1G
    roLroCsda13 ext4-a-a /-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 48.9G
    roLroCsda11 ext4-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 24.4G
    roLroCsda8-a ext4-a-a /home-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 223.1G
    rooroCsda6-a ext3-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a /MDA2009-a 10.4G
    [root@localhost daniel]#

    I want to back-up my 500GB Internal HD to a 2TB External HD. Previously
    (i.e. at about the time I installed MGA6), I used a single 'dd' command
    to copy the entire 500GB to the ext drive (including the 4GB SWAP
    Partition) back some time ago.

    Reading up yesterday (which, of course, I can't locate tonight), which
    ever web sight it was gave me the impression I could use the 'dd'
    command to back-up partition one at a time .... but, on that web-page,
    the back-up was onto the same, internal, hard-drive.

    To save me backing up the (useless) Swap drive to my external
    Hard-drive, can I use 'dd' to back up, one partition at a time, to my
    External Hard-Drive??

    e,g, dd if sda1 of sdb/240120/Win7Sys/

    then

    dd if sda2 of sdb/240120/WinEXE/sdb2/240120/WinEXE/

    and

    dd if sda3 of sdb/240120/WinStuff/

    and

    dd if sda6 of sdb/240120/MDA2009

    and

    dd if sda10 of sdb/240120/MGA4

    etc ... etc ... etc??

    Or might there be a more suitable command to carry out my situation??

    The dd command works fine with individual partitions, provideded you are
    ok including free space
    in the backup. For example "dd if=/dev/sda1 of=/sdb/$PATHTOBACKUP/sda1.backup bs=1M".
    That puts a backup into a file, which you can compress if needed for the backup.

    If you want to copy it to a newly created partition on a new drive, the
    new partition must be
    created first, with exactly the same number of sectors, and then the contents copied
    For example, if the new partition has been created as /dev/sdc10, then
    to copy it from sda10,
    "dd if=/dev/sda10 of=/sdc10 bs=1M".

    Don't forget the bs=1M whenever copying anything larger than a sector (normally 512 bytes).

    My desktop system died recently. I'm currently using my laptop. For my backups I use rsync,
    to copy directories and the files only. No free space or swap in the
    backup, and only backed
    up /etc, /home, parts of /var, /root, and /usr/local.

    For the backup of each directory I used commands such as ...
    rsync -auvxSP --specials --delete-a --exclude="lost+found" /usr/local/ /s3/usr/local/
    That was with the usb backup partition mounted on /s3.

    For the restore to my laptop, I used ...
    rsync -auvxSP --specials --delete-a --exclude="lost+found" /run/media/dave/BACKUP/usr/local/ /usr/local/

    The-a --exclude="lost+found" isn't needed in this case. I leave it in as
    I just copy/paste the line
    and change the directories as needed.

    I normally run the rsync commands as root. Some of the uid/gid for the
    file owners are
    different, so I then use chown as needed.

    As my laptop already had stuff on it, I only restored what I needed from within some of the
    backup directories.

    Regards, Dave Hodgins

    Thank you, Thank you, Thank you, David. So full of information .... as
    usual!!
    --
    Daniel
    --- Synchronet 3.21d-Linux NewsLink 1.2