[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2737
  • Last Modified:

lvextend and resize2fs without umount?

can we increase the filesystem without umount? Would it corrupt any data?
0
mokkan
Asked:
mokkan
  • 4
  • 2
  • 2
3 Solutions
 
arnoldCommented:
Backup and try.
Better safe than sorry, would be the advice to resize while the filesystem is not in use by other services. and a goof backup exists just in case.
the resize2fs is more risky as compared to the lvextend
Presumably you have already expanded the Volume group (vgextend) or do you have excess room in the volume group?
0
 
underskyCommented:
if you want resize or work with mounted system, mount it with read only parametrs, so you not lose any data.

but many programs for resize today, not allow you work with mounted system anyway.
0
 
mokkanAuthor Commented:
thank you. what is the difference between resize2fs and ext2online?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
arnoldCommented:
ext2online will only resize ext2 mounted filesystem.

resize2fs will resize an ext2 or ext3 unmounted file system.
0
 
mokkanAuthor Commented:
How can we execute on mounted file system?
0
 
mokkanAuthor Commented:
How can we execute on mounted ext3 file system? Or what command we can execute?
0
 
underskyCommented:
Different between mounted system, or not  mounted, in Linux filesystem, mounted file system always
wright/read data

you can get list of open files by

lsof
or
sudo lsof

so if you resize partition, you must have free space, ext2online i think just add new free space in allocation table, but i think they can only large size..

So whats bad if you work with Resize, fsck and other things in mounted file system:

Programm, change file allocation, and in same time, Linux may wright data in same place, so data moved, and Linux wright new data, on empty space, or in programm/log/tmp, or cache data.. so it can broke this file..

 Most Vaulrnable if you work in mounted FS is : /var , /etc , /tmp /usr (config files), but if programm like resize2fs, start moving any system file, and any daemon/program, or process, wright data on disk, they could seriously damage your system.. but this is 5-10% of chance, becouse most of all /sbin /boot /bin files, are always static..

btw resize2fs, can also move partitions..

so best way, to prevent any damage is remout filesystem in RO mode..
most of "damage or not" depends, where your logical disc is

like:

[[       /root            ext 4               ] [         /boot     ext4       ][           /partition that i want to resize    ]       empty space       ]


so in this state, this is safaty to resize it.. but here:

[[empty space  [            /root               ][        /partition for resize ] [        /boot        ]

to resize your partition
1. you need move /root partition to start of system (i miss that / you can't load this disk on most system, becouse of 1024 cylinder problem)
2. then you add size into !START of logical disk, so, and other files into /partition for resize
move on their allocation table

like we start from

file 1 0x00000001
file 2 0x00000004
file 3 0x00000005


then

file 1 0x00000005
file 2 0x00000008
file 3 0x00000009

so on mount system if any process wright data on file 2, they just damage file 1 and overwright it.

in first state you just add more disk space so discriptors not changes, and file system not been damaged.
0
 
mokkanAuthor Commented:
thank you.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now