User Tools

Site Tools


convert_root_to_lvm_partition

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
convert_root_to_lvm_partition [2023/01/17 15:23] osoconvert_root_to_lvm_partition [2024/10/17 21:42] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Convertir root (/) a LVM ====== ====== Convertir root (/) a LVM ======
 +
 +<WRAP center round alert 80%>
 +===== Esto nunca funcionó!! =====
 +Terminé reinstalando Ubuntu (no venía mal) y habilitando LVM para agregar otro SSD.
 +Llegué hasta el bind mount para crear el initramfs. Tal vez otro día lo retome usando una VM en vez de hacerlo sobre la PC principal.
 +</WRAP>
  
 Se puede crear una partición lógica con ''fdisk'' Se puede crear una partición lógica con ''fdisk''
Line 51: Line 57:
 <code bash>/dev/vg_new_root/lv0      /       ext4    defaults     1 1 </code> <code bash>/dev/vg_new_root/lv0      /       ext4    defaults     1 1 </code>
  
-<code bash> </code> +hacer un bind mount entre lo actual y lo que se copió 
-<code bash> </code>+<code bash>mount --bind / /mnt/ssd/ </code> 
 +<WRAP center round info 60%> 
 +A bind mount is an alternate view of a directory tree. Classically, mounting creates a view of a storage device as a directory tree. A bind mount instead takes an existing directory tree and replicates it under a different point. The directories and files in the bind mount are the same as the original. Any modification on one side is immediately reflected on the other side, since the two views show the same data. 
 + 
 +For example, after issuing the Linux command- 
 + 
 +mount --bind /some/where /else/where 
 + 
 +the directories /some/where and /else/where have the same content, which is the content of /some/where. (If /else/where was not empty, its previous content is now hidden.) 
 + 
 +Unlike a hard link or symbolic link, a bind mount doesn't affect what is stored on the filesystem. It's a property of the live system. 
 +</WRAP> 
 + 
 +//we have to change the root to the new file system, followed by creating initrd with raid as well as lvm support// 
 +tocar el nuevo direectrio con ''chrooot'' 
 +<code bash># chroot /mnt/ssd/ </code> 
 +<WRAP center round info 60%> 
 +A chroot is an operation that changes the apparent root directory for the current running process and their children. A program that is run in such a modified environment cannot access files and commands outside that environmental directory tree. This modified environment is called a chroot jail. 
 +</WRAP> 
 + 
 + 
 +<code bash># mount -t proc /proc /proc </code> 
 + 
 +<code bash># mount -t sysfs /sys /sys </code> 
 + 
 +<code bash>vgscan </code> 
 + 
 +<code bash>vgchange -ay </code> 
 + 
 +<code bash>mkinitramfs -o /boot/initrd-`uname -r`.lvm.img `uname -r` </code> 
 + 
 +<code bash>umount /sys</code> 
 + 
 +<code bash>umount /proc</code> 
 + 
 +volver a la nornalidad, fuera de chroot 
 +<code bash>exit </code> 
 + 
 +<code bash>update-grub </code> 
 + 
 +<code bash>reboot </code> 
 + 
  
 ===== Para borrar el LV ===== ===== Para borrar el LV =====
convert_root_to_lvm_partition.1673969026.txt.gz · Last modified: 2024/10/17 21:42 (external edit)