Удаление строк из одного файла на основе несуществования в другом

Это не имеет никакого отношения к Debian, проблема, которую Вы испытываете, происходит задолго до того, как операционная система запускается. То, что является странным, - то, что это только иногда происходит.

Одна возможность состоит в том, что у Вас есть провальный жесткий диск. Проверьте вывод

sudo smartctl -a /dev/sda

Необходимо видеть строку как это:

SMART overall-health self-assessment test result: PASSED

Если Ваш GRUB не установлен на /dev/sda, замена /dev/sda с правильным устройством. Вы, возможно, должны установить smartctl:

sudo apt-get install smartmontools

ОБНОВЛЕНИЕ

Вывод, который Вы отправили, содержит эти строки:

 ATA Error Count: 1652 (device log contains only the most recent five errors)
[...]
 Error 1652 occurred at disk power-on lifetime: 5265 hours (219 days + 9 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 2d 51 60 e0 Error: UNC at LBA = 0x0060512d = 6312237

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 01 2d 51 60 00 00 00:16:03.660 READ DMA
27 00 00 00 00 00 00 00 00:16:03.660 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 00 00 00:16:03.651 IDENTIFY DEVICE
ef 03 46 00 00 00 00 00 00:16:03.644 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 00 00 00:16:03.643 READ NATIVE MAX ADDRESS EXT

Error 1651 occurred at disk power-on lifetime: 5265 hours (219 days + 9 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 2d 51 60 e0 Error: UNC at LBA = 0x0060512d = 6312237

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 01 2d 51 60 00 00 00:16:01.486 READ DMA
27 00 00 00 00 00 00 00 00:16:01.486 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 00 00 00:16:01.477 IDENTIFY DEVICE
ef 03 46 00 00 00 00 00 00:16:01.470 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 00 00 00:16:01.470 READ NATIVE MAX ADDRESS EXT

Error 1650 occurred at disk power-on lifetime: 5265 hours (219 days + 9 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 2d 51 60 e0 Error: UNC at LBA = 0x0060512d = 6312237

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 01 2d 51 60 00 00 00:15:59.544 READ DMA
27 00 00 00 00 00 00 00 00:15:59.544 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 00 00 00:15:59.535 IDENTIFY DEVICE
ef 03 46 00 00 00 00 00 00:15:59.528 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 00 00 00:15:59.528 READ NATIVE MAX ADDRESS EXT

Error 1649 occurred at disk power-on lifetime: 5265 hours (219 days + 9 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 2d 51 60 e0 Error: UNC at LBA = 0x0060512d = 6312237

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 01 2d 51 60 00 00 00:15:57.486 READ DMA
27 00 00 00 00 00 00 00 00:15:57.486 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 00 00 00:15:57.478 IDENTIFY DEVICE
ef 03 46 00 00 00 00 00 00:15:57.478 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 00 00 00:15:57.478 READ NATIVE MAX ADDRESS EXT

Error 1648 occurred at disk power-on lifetime: 5265 hours (219 days + 9 hours)
When the command that caused the error occurred, the device was active or idle.

Так, похоже, что у Вас есть проблемы при чтении из диска. Если это недавно запустилось, Ваш диск, вероятно, был поврежден. Я рекомендую, чтобы Вы сделали резервное копирование быстро и купили новый диск.

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

2
21.11.2018, 23:28
3 ответа
awk 'FNR == NR { onecol[$0]=1;next; }; $1 in onecol' fileB fileA
3
27.01.2020, 21:50
join fileA fileB

, который предполагает, что файлы отсортированы на первом столбце (что они находятся в вашем примере).

5
27.01.2020, 21:50
awk '{if(NR==FNR) a[$1]=$1}{if($1==a[$1] && NR>FNR) print $0}' fileB.txt fileA.txt
1
27.01.2020, 21:50

Теги

Похожие вопросы