MonthApril 2010

fsck in SunOS 5.1 i386 processor

Yesterday was not a good day, gnome-session was dead in my Linux core machine causes some failure to my apps. My perforce proxy server is upside down,  seems like the hardware is dying soon. As usual, unless the server has death certification, else we will continue to squeeze it….

Trying to google around for SUN OS single mode (without cd) boot up so i can run fsck on root volume. This is the finding i have for SunOS 5.1 i386 after combining all article read.

Run fsck in SunOS 5.1

1. Boot into single mode

reboot — -m milestone=”none”

2. run

fsck -F ufs /dev/rdsk/c0t0d0s0

Result:

** phase 1 – Check Blocks and Sizes
** phase 2 – Check Pathnames
** phase 3 – Check Connectivity
** phase 4 – Check Reference Counts
** phase 5 – Check Cylinder Groups

I am safe, no bad superblock or sector. However, if you are running into trouble like : corrupted super block

newfs -Nv /dev/rdsk/c0t0d0s0

to obtain the block number of Superblock backup’s. Then finally

fsck -F ufs -o -b=32 /dev/rdsk/c0t0d0s0

*When you created new file system, alternate superblock was created as well, we are using this technique to repair bad superblock.

I will need to use smartd to scan the harddisk in SUN. write this on next post later on.

LVM extend in live mode!

Q: I have a LVM(logical volume) in my Linux, i need to extend the size without offline the logical volume.

A:

You will need to ensure you have spaces in volume group. Assuming the VG name is : VolGroup00.

[root@linux1 data]# vgdisplay
— Volume group —
VG Name               VolGroup00
System ID
Format                lvm2
Metadata Areas        1
Metadata Sequence No  10
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                8
Open LV               8
Max PV                0
Cur PV                1
Act PV                1
VG Size               1.36 TB
PE Size               32.00 MB
Total PE              44703
Alloc PE / Size       28570 / 872.81 GB
Free  PE / Size       16133 / 524.16 GB
VG UUID               d2vwa2-6JHI-lTXJ-0WHg-iXhv-6COc-h01kf6

According to “Free PE/Size” you have 524.16GB left . Then you are good to proceed with the steps.

Lets check the current size of the LV you want to resize

[root@linux1 data]# df -h .
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-lvdata
296G  191M  281G   1% /data

Lets start increasing the size!

[root@linux1 data]# lvextend -L+20G /dev/VolGroup00/lvdata
Extending logical volume lvdata to 320.00 GB
Logical volume lvdata successfully resized

Then resize it live!

[root@linux1 data]# resize2fs /dev/VolGroup00/lvdata
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/lvdata is mounted on /data; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/lvdata to 83886080 (4k) blocks.
The filesystem on /dev/VolGroup00/lvdata is now 83886080 blocks long.

The final output you are looking for 🙂

[root@linux1 data]# df -h .
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-lvdata
315G  195M  299G   1% /data

Easy right? The original guide in Redhat showed “ext2online” but i don’t see it in my /sbin ! Luckily my best friend google told me resize2fs is the new method 🙂 Redhat you should update your documentation!

© 2018 Thinkway

Theme by Anders NorénUp ↑