It’s happened to all that your system after an upgrade or even for no apparent reason decided to die and not restart. At this point you try to start in Safe Mode, or search the installation CD and start to do guess … or you can use SystemRescueCd, it does not necessarily solve every problem, but you’ll arrive at the verdict and analysis much faster.
SystemRescueCd is a Linux system rescue disk available as a bootable CD-ROM or USB stick for administrating or repairing your system and data after a crash. It aims to provide an easy way to carry out admin tasks on your computer, such as creating and editing the hard disk partitions.
Let’s see some work we can achieve with our CD (or USB stick)
1) Expanding A Root-FS
Disclaimer: This task could be very dangerous for your installation, so take a backup of your system, and use this guide as a rough guide, and has to be adapted to the concrete setup. This procedure has been developed for a system running with the root filesystem being LVM2 based ext3, inside a SAN.
Once finished boot process you will have access to the command line, first identify the volume group:
The output should be like this:
— Volume group —
VG Name root_vg
VG Access read/write
VG Status available/resizable
VG # 0
MAX LV 256
Cur LV 4
Open LV 3
MAX LV Size 255.99 GB
Max PV 256
Cur PV 1
Act PV 1
VG Size 31.21 GB
PE Size 4 MB
Total PE 7990
Alloc PE / Size 6884 / 26.89 GB
Free PE / Size 1914 / 7.48 GB
VG UUID HM62Tf-ZNqn-m059-48MV-u4Uf-MpC0-leO586
Case A – We have the root partition on a volume group with available space, Free PE/Size > 0 (best option)
In this case, just expand the logical volume where lies the root filesystem (/) and then act to widen even the file system, we say that we want to expand the filesystem to 5 GB.
Look at the name of the logical volume, doing a ls -l /dev/VGNAME, in my case ls -l /dev/root_vg and i’ve found that my logical volume name is root_lv (if your system is still up with the original OS, you can see the logical volume name with a df, just check the device in the first column).
Now extend the logical volume with this command:
lvextend -v -L+5G /dev/root_vg/root_lv
And now extend the file system too:
e2fsck -f /dev/root_vg/root_lv&& resize2fs -p /dev/root_vg/root_lv
This may take some time, depending on the size of your filesystem.
To do a test mount the filesystem in read only:
mount -o ro /dev/root_vg/root_lv
If this is successful, you can give a , and you should find yourself on your operating system with the filesystem / extended.
Case B – We have the root partition on a volume group without available space, Free PE/Size = 0.
We then have to add to the volume group (always root_vg) a new disk or a new partition, in this example we’ll add the third partition of the first disk, named in linux sda3.
So this time we extend the volume group, adding the new partition:
vgextend -v root_vg /dev/sda3
Check whether this is ok by doing a
vgdisplay -v root_vg | less
If everything is ok there should be an amount of free PhysikalExtents, that could all (or partially) be added to the Logical Volume.
Now you can follow the instructions in Case A.
2) Scan your Windows partition/computer for Virus with SystemRescueCD
Your windows has problems starting and you think I can depend on a Virus?
Launch SystemRescueCd and once arrived at the command line use the following commands:
This will start clamav daemon, an open source antivirus, wait for a moment and you should be back at command prompt.
If SystemRescueCd has initialized correctly your network, than update the antivirus DB with the command:
Now mount the partition where is your windows, if you are unsure about what is correct you can use the application gparted , in this example we will assume that the NTFS partition on which Windows is located is sda5.
We then mount the partition:
mount /dev/sda5 /mnt/windows
Change the current directory to the root of the windows partition:
Invoke the virus checker itself and select recursive operation:
Clamscan we will report any and all infected files will find that we can then move them to a quarantine area with linux.
At last, to partition your hard disk i suggest this nice guide:
Full video of boot via PXE of SystemRescueCD: