Jump to content

Восстановление системы из бекапа


Recommended Posts

Пытаюсь развернуть бекап системы, но нигде не нашел ответа и поэтому решил это сделать интуитивно учитывая мой нубизм. Шаги были такие:

1. Сделал бекап по инструкции

tar cvzf /opt/backup.tar.gz -C /opt .

2. Создал в папку OPKG/opt/install и поместил в нее архив бекапа backup.tar.gz

3. Отмонтировал диск в веб-интерфейсе 

4. Примонтировал диски заново в веб-интерфейсе, произошла распаковка

Но старые папки и файлы, которые были сделаны до бекапа все равно остались в системе. Я правильно понимаю, что можно было загрузиться с условно чистого диска с entware, отформотировать рабочий entware, а потом на него накатывать бекап? Или как?

список устройств

Link to comment
Share on other sites

 

Сам нашел решение и поэтому пишу инструкцию

1. Грузимся с чистого раздела с Entware в моем случае Recovery

2. Запускаем fdisk командой. В данном случае /sda — это внешний hdd целиком

fdisk /dev/sda

3. Удаляем раздел с основной системой OPKG, это раздел /dev/sda2. Все делалось по мануалу

Spoiler

 


~ # fdisk /dev/sda

Welcome to fdisk (util-linux 2.35.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: 00BPVT-22HXZT3  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C8669421-70A2-4B91-AAB2-89FDBAC1ED52

Device        Start       End   Sectors  Size Type
/dev/sda1      2048   9768959   9766912  4.7G Microsoft basic data
/dev/sda2   9768960  19537919   9768960  4.7G Linux filesystem
/dev/sda3  19537920  20541439   1003520  490M Microsoft basic data
/dev/sda4  20541440 976773119 956231680  456G Apple HFS/HFS+

Command (m for help): d
Partition number (1-4, default 4): 2

Partition 2 has been deleted.

Command (m for help): w
The partition table has been altered.
Failed to remove partition 2 from system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot. 
Syncing disks.

 

 

4. Далее ребут системы, которая при запуске покажет отсутствие /dev/sda2. Его мы и будем восстанавливать. Монтируем Recovery (/dev/sda1), включаем OPKG в настойках роутера. После чего начинаем создавать раздел. 

Spoiler

~ # fdisk /dev/sda

Welcome to fdisk (util-linux 2.35.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: 00BPVT-22HXZT3  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C8669421-70A2-4B91-AAB2-89FDBAC1ED52

Device        Start       End   Sectors  Size Type
/dev/sda1      2048   9768959   9766912  4.7G Microsoft basic data
/dev/sda3  19537920  20541439   1003520  490M Microsoft basic data
/dev/sda4  20541440 976773119 956231680  456G Apple HFS/HFS+

Command (m for help): n
Partition number (2,5-128, default 2): 2
First sector (9768960-976773134, default 9768960): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (9768960-19537919, default 19537919): 

Created a new partition 2 of type 'Linux filesystem' and of size 4.7 GiB.
Partition #2 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: no

Command (m for help): w

The partition table has been altered.
Syncing disks.

 

Все, раздел создан. Однако, почему раздел не форматируется. Непонятно

Edited by mr.robot
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...