Sponsored Content
Full Discussion: Removed ^M from Libraries
Top Forums UNIX for Advanced & Expert Users Removed ^M from Libraries Post 302231302 by buffoonix on Tuesday 2nd of September 2008 04:55:08 AM
Old 09-02-2008
I never questioned that.
As the other poster already said, it's time to role the restore from the backup.
Just an aside,
if you (the thread issuer) like me have your filesystems on LVM volumes (yes I do have a separate lv_usr)
there is a neat feature that can be used for rolling back quickly from an unfortunate experiment like yours without even rolling a regular backup.
Before I do such dubious recursive substitutions I just would create a snapshot volume of the affected LV like
Code:
[root@toshsat:~]
# df /usr
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vgfc-lv_usr
                       5160576   3193892   1704540  66% /usr
[root@toshsat:~]
# vgdisplay vgfc|egrep 'PE Size|Free  PE'
  PE Size               8.00 MB
  Free  PE / Size       11 / 88.00 MB
[root@toshsat:~]
# lvcreate -s -n snapof_usr -l 11 /dev/vgfc/lv_usr
  Logical volume "snapof_usr" created
[root@toshsat:~]
# lvs -o lv_name,lv_size,origin,snap_percent vgfc
  LV           LSize   Origin Snap% 
  lv_depot       9.80G              
  lv_home      512.00M              
  lv_opt       512.00M              
  lv_root        1.00G              
  lv_tmp       512.00M              
  lv_usr         5.00G              
  lv_usr_local 256.00M              
  lv_var         1.00G              
  snapof_usr    88.00M lv_usr   0.01

Above I only created a snapshot of 88 MB of the 5 GB /usr volume because I hadn't any more free PEs in my vgfc.Smilie
Normally, one would adapt this to the size of the snapped of LV and the anticipated amount of changes during the period one would possibly require the snapshot.
As a rule of thumb 10% suffice, but this depends on the changes in the filesystem.
Since /usr is pretty static (and even could be mounted ro often) there won't be many changes.
From the lvs command above you can watch the filling up of the snapshot with the changes.
Once the snap_percent approaches 100% your snapshot is useless and can't be any longer used for recoveries.
Now you can safely run your command.
If something goes wrong, you simply mount the snapshot volume ro somewhere and run your restore.
Once you no longer need your snapshot simply lvremove it.
Code:
[root@toshsat:~]
# mount -r /dev/vgfc/snapof_usr /mnt/tmp2
[root@toshsat:~]
# df /usr /mnt/tmp2
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vgfc-lv_usr
                       5160576   3193892   1704540  66% /usr
/dev/mapper/vgfc-snapof_usr
                       5160576   3193892   1704540  66% /mnt/tmp2
[root@toshsat:~]
# umount /mnt/tmp2
[root@toshsat:~]
# lvremove -f /dev/vgfc/snapof_usr 
  Logical volume "snapof_usr" successfully removed


Last edited by buffoonix; 09-02-2008 at 06:03 AM..
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Will Old Files Be Removed

I have windows Xp installed, and decided to install Solaris Sun Unix 10. The hard disk was previousely partitioned into 5 partition. C: = Win98 D = WinXP and e,f,g,h are applications and so on. When istalling Sun Unix, will all the drives be removed, or I will specify where to install it. Thanks... (5 Replies)
Discussion started by: sunsation
5 Replies

2. Shell Programming and Scripting

directories are not getting removed

hello Everyone. I'm having the following problem: I have number of installation in the directory. each installation consists of executable file and directory. when I do the new installation I move old one to File_name-Time_stamp. this is done for executable and for directory. Everything is done... (6 Replies)
Discussion started by: slavam
6 Replies

3. UNIX for Dummies Questions & Answers

recovering files removed with rm

Hello, I was reading the manual on rm and it states that when you use 'rm' the files are usual recoverable, how is this done? Does it assume that a backup system is in place? Cheers Jack (4 Replies)
Discussion started by: jack1981
4 Replies

4. UNIX for Dummies Questions & Answers

a way to tell what was removed after rm -rf ?

Hello all! I ran rm -rf on a wrong directory, noticed it and hit ctrl-c. Is there any way on a debian machine to tell what actually got deleted? As there were many dirs and files in this directory that I don't care for, I'd like to see if anything important was removed. Or do you know in... (4 Replies)
Discussion started by: thosch
4 Replies

5. Shell Programming and Scripting

Duplicates to be removed

Hi, I have a text file with 2000 rows and 2000 columns (number of columns might vary from row to row) and "comma" is the delimiter. In every row, there maybe few duplicates and we need to remove those duplicates and "shift left" the consequent values. ex: 111 222 111 555 444 999 666... (6 Replies)
Discussion started by: prvnrk
6 Replies

6. Shell Programming and Scripting

Removed Lines

Hi Guys, I am using SunOS 5.9 running Oracle Databases on it... I have log files that I suspect that some lines within the logs where removed. How do I tell if indeed some lines within a particular file where removed and by whom? Thanks in advance (2 Replies)
Discussion started by: Phuti
2 Replies

7. Linux

file removed

Hi Team, I have deleted a file accidentally by using rm command. I am not the root(admin) user. Can you please let me know how to get that .tex file? (2 Replies)
Discussion started by: darling
2 Replies
LVDISPLAY(8)						      System Manager's Manual						      LVDISPLAY(8)

NAME
lvdisplay - display attributes of a logical volume SYNOPSIS
lvdisplay [-a|--all] [-c|--colon] [-d|--debug] [-h|-?|--help] [--ignorelockingfailure] [--maps] [--nosuffix] [-P|--partial] [--units hHbB- sSkKmMgGtTpPeE] [-v|--verbose] [--version] [LogicalVolumePath [LogicalVolumePath...]] lvdisplay --columns | -C [--aligned] [-a|--all] [-d|--debug] [-h|-?|--help] [--ignorelockingfailure] [--noheadings] [--nosuffix] [-o|--options [+]Field[,Field]] [-O|--sort [+|-]Key1[,[+|-]Key2[,...]]] [-P|--partial] [--segments] [--separator Separator] [--unbuffered] [--units hHbBsSkKmMgGtTpPeE] [-v|--verbose] [--version] [LogicalVolumePath [LogicalVolumePath...]] DESCRIPTION
lvdisplay allows you to see the attributes of a logical volume like size, read/write status, snapshot information etc. lvs (8) is an alternative that provides the same information in the style of ps (1). lvs is recommended over lvdisplay. OPTIONS
See lvm for common options and lvs for options given with --columns. --all Include information in the output about internal Logical Volumes that are components of normally-accessible Logical Volumes, such as mirrors, but which are not independently accessible (e.g. not mountable). For example, after creating a mirror using 'lvcreate -m1 --mirrorlog disk', this option will reveal three internal Logical Volumes, with suffixes mimage_0, mimage_1, and mlog. -c, --colon Generate colon separated output for easier parsing in scripts or programs. N.B. lvs (8) provides considerably more control over the output. The values are: * logical volume name * volume group name * logical volume access * logical volume status * internal logical volume number * open count of logical volume * logical volume size in sectors * current logical extents associated to logical volume * allocated logical extents of logical volume * allocation policy of logical volume * read ahead sectors of logical volume * major device number of logical volume * minor device number of logical volume -m, --maps Display the mapping of logical extents to physical volumes and physical extents. To map physical extents to logical extents use pvs --segments -o+lv_name,seg_start_pe,segtype. --columns | -C Display output in columns, the equivalent of lvs. Options listed are the same as options given in lvs (8). Examples "lvdisplay -v /dev/vg00/lvol2" shows attributes of that logical volume. If snapshot logical volumes have been created for this original logical volume, this command shows a list of all snapshot logical volumes and their status (active or inactive) as well. "lvdisplay /dev/vg00/snapshot" shows the attributes of this snapshot logical volume and also which original logical volume it is associated with. SEE ALSO
lvm(8), lvcreate(8), lvscan(8), pvs(8) Sistina Software UK LVM TOOLS 2.02.95(2) (2012-03-06) LVDISPLAY(8)
All times are GMT -4. The time now is 01:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy