aboutsummaryrefslogtreecommitdiff
path: root/boot-disk-bash-history
blob: b604952a37ab904d9be08e93e5839d4b5cc916eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
apt-get install openssh-server
reboot
apt install --yes debootstrap gdisk zfs-initramfs mdadm grub-pc linux-image-generic zsys
zpool import rpool
zpool import bpool
zpool list
zpool status
zpool status -L
grub-probe
nano /boot/grub/grub.cfg
update-grub
zpool export -a
zpool import -N -R /mnt rpool
zpool import -N -R /mnt bpool
zfs load-key -a
zfs mount -a
zpool list
mount --rbind /dev  /mnt/dev
mount --rbind /proc /mnt/proc
mount --rbind /sys  /mnt/sys
mount -t tmpfs tmpfs /mnt/run
chroot /mnt /bin/bash --login
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' |     xargs -i{} umount -lf {}
zpool export -a

cd /etc/grub.d/
nano /etc/default/grub
update-grub
cat /boot/grub/grub.cfg
reboot
nano /etc/default/grub
update-grub
reboot

fdisk -l
zfs list
zpool list
apt-get install gparted
zpool list -L
zpool import
zpool list -L
zpool export
zpool export rpool
zpool import rpool
zpool import bpool
zpool export rpool
zpool import rpool
zpool list -L
zpool status -L
fdisk -l

zpool detach ata-TEAML5Lite3D240G_AB20190109A0101064-part6
zpool export rpool
zpool import rpool oldrpool

mkdir /oldroot /newroot
fdisk /dev/sde
.... delete partition six and split it into 2 new partitions ....
ls -lsa /dev/disk/by-id/|grep sde7
zpool create rpool ata-TEAML5Lite3D240G_AB20190109A0101064-part7
zpool export oldrpool
zpool import -R/oldroot oldrpool
zpool export rpool
zpool import -R/newroot rpool
zfs snapshot -r oldrpool@for_copy
zfs send -R oldrpool@for_copy | zfs recv -F rpool
zpool list

# attach mirror to boot pool.
ls -ls /dev/disk/by-partuuid/|grep sde6
zpool attach bpool ata-TEAML5Lite3D240G_AB20190109A0101064-part6
zpool status bpool
ata-TEAML5Lite3D240G_AB20190109A0101064-part7
#
zpool detach bpool d3bff208-06
zpool status bpool
zpool status
zpool status rpool
update-grub
fdisk -l

# copy partitions
sgdisk -p /dev/sde
sgdisk -R/dev/sdc /dev/sde
sgdisk -G /dev/sdc
partprobe

ls -ls /dev/disk/by-partuuid/|grep sdc6
zpool attach bpool ata-TEAML5Lite3D240G_AB20190109A0101064-part6 ata-Crucial_CT240M500SSD1_132909461FE4-part6
ls -ls /dev/disk/by-partuuid/|grep sdc7
zpool attach rpool ata-TEAML5Lite3D240G_AB20190109A0101064-part7 ata-Crucial_CT240M500SSD1_132909461FE4-part7 -o ashift=9
zpool export rpool
zpool import -R/ rpool
update-grub
reboot