LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-05-2016, 08:09 AM   #1
Glenn D.
Member
 
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 132

Rep: Reputation: 26
How can I find 'find last used block + 1' on a reiser4 partition and truncate it so I can use spare space for another partition type. ?


Questions:
- How can I find 'find last used block + 1' on a reiser4 partition and truncate it so I can use spare space for another partition type . ?


Any tools or commands to do/find this ?
Thanks
--Glenn


blocks: 488378640
free blocks: 217146980
file count: 188313

##

using opensuse and Reiser4 enabled kernel
partition details and followig shows:

# fdisk -l
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

# mount /dev/sdb /media/disk

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb 1.8T 747G 1.0T 43% /media/disk

# umount /dev/sdb


# fsck.reiser4 --check /dev/sdb
*******************************************************************
This is an EXPERIMENTAL version of fsck.reiser4. Read README first.
*******************************************************************

Fscking the /dev/sdb block device.


Will check the consistency of the Reiser4 SuperBlock.


Will check the consistency of the Reiser4 FileSystem.


Continue?


(Yes/No): yes
***** fsck.reiser4 started at Tue Feb 24 17:03:22 2015
Reiser4 fs was detected on /dev/sdb.


Master super block (16):
magic: ReIsEr4
blksize: 4096
format: 0x0 (format40)
uuid: 3006ced1-7490-4ea8-a9b8-d82143c6bede
label: <none>

Format super block (17):
plugin: format40
description: Disk-format plugin.
version: 0
magic: ReIsEr40FoRmAt
mkfs id: 0x1ddaf754
flushes: 0
blocks: 488378640
free blocks: 217146980
root block: 37017218
tail policy: 0x2 (smart)
next oid: 0xedade
file count: 188313
tree height: 6
key policy: LARGE
 
Old 09-05-2016, 08:59 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
I have not used reiserfs in some time but resize_reiserfs should be able to shrink the filesystem. Since your drive is not partition that should be the only step required.

Make sure you have a good backup just in case...

Last edited by michaelk; 09-05-2016 at 09:02 AM.
 
Old 09-05-2016, 09:23 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Just how do you plan to have "another partition type" on a drive that is not partitioned?
 
Old 09-05-2016, 09:27 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Good point. I feel stupid...
 
Old 09-05-2016, 09:40 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I think all of us have made posts here that overlooked something fundamental.

Anyone who takes on the task of moderating this mass of postings has my deepest respect.
 
Old 09-06-2016, 03:01 AM   #6
Glenn D.
Member
 
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 132

Original Poster
Rep: Reputation: 26
Hello,

Answer to Question "Just how do you plan to have "another partition type" on a drive that is not partitioned?"

My thinking

So disk may have:

###.#..#..##.........

# = used blocks
. = free blocks

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb 1.8T 747G 1.0T 43% /media/disk

unmounted [/dev/sdb]
# fdisk -l /dev/sdb

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

step 1. Shrink Reiser4 partition.
[I need tools to shrink Reiser4 volume but cannot find any]
need to find block number of 'last used block + 1'


- Disk I think has a quantity of free space at the end of the Reiser 4 partition

step2.
I need some tools to find block number of 'last used block + 1'

[need tools/commands to shrink Reiser4 volume but cannot find any]

create reiser3 [reiserfs] partition in spare space after last block used of [reiser4] partition.

resize_reiserfs cant shrink Reiser4 partition - I tried.
[error as follows]

# resize_reiserfs -s -1G /dev/sdb
resize_reiserfs 3.6.24

cannot open '/dev/sdb': Unknown error 2127439231
#

Anyone know of tools to shrink Reiser4 partition


Details about volume and space used
-----------------------------------

blocks: 488378640
free blocks: 217146980
file count: 188313


Thanks for your help
--Glenn
 
Old 09-06-2016, 07:00 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
You need to think about what has been said to you.
You cannot simply add a partition to this device. Period.

You (presumably) chose to use the entire (unpartitioned) device for your data. You cannot change that without reformatting the device. Back up your data and do as you must. FWIW I too gave up on reiser many years ago.
 
Old 09-06-2016, 07:04 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by syg00 View Post
You need to think about what has been said to you.
You cannot simply add a partition to this device. Period.

You (presumably) chose to use the entire (unpartitioned) device for your data. You cannot change that without reformatting the device. Back up your data and do as you must. FWIW I too gave up on reiser many years ago.
Surely if OP were to find a way of resizing and compacting his reiser4 filesystem, he could then reduce the partition size and create a new partition in the remaining disk space? Or are you saying that reiser4 doesn't support such resizing and compacting?
 
Old 09-06-2016, 07:11 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Nothing to do with the filesystem - there is no partition table.
 
Old 09-06-2016, 07:41 AM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by syg00 View Post
Nothing to do with the filesystem - there is no partition table.
Ah, thanks. I've only ever dealt with partitioned disks. I didn't realise that you couldn't partition a non-partitioned disk after the fact.
 
Old 09-06-2016, 07:48 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
The MBR is not protected or reserved space nor is there a requirement you have to have one. If the OP creates one after the fact the existing data will be lost.
 
Old 09-06-2016, 07:55 AM   #12
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by michaelk View Post
The MBR is not protected or reserved space nor is there a requirement you have to have one. If the OP creates one after the fact the existing data will be lost.
Would creating a LVM partition based on the underlying raw disk and then using lvreduce (after, somehow, compacting the reiser4 filesystem) work?
 
Old 09-06-2016, 08:36 AM   #13
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by hydrurga View Post
Would creating a LVM partition based on the underlying raw disk and then using lvreduce (after, somehow, compacting the reiser4 filesystem) work?
The runs into the same problem as adding a partition table. The LVM PV header would be placed at the beginning of the disk, overwriting the start of the existing reiserfs filesystem.

The free space in the existing filesystem is currently less than 50% of the disk (blocks: 488378640, free blocks: 217146980). There simply isn't enough room to make a new copy of the data elsewhere on that same disk, and I don't know of any existing tool that supports an overlapping move of a filesystem. Yes, it's possible in concept to cobble together something using dmsetup mappings to shift a filesystem in sections, but that's going to be a lot more work, and a lot more dangerous, than just saving the data somewhere else and reformatting the disk.

And, if you don't have "somewhere else" to save the data, then your data is apparently not important enough to you to be worth having a backup, so why worry about it?
 
  


Reply

Tags
partioning



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shrinking root partition and using free space to create a block device kickdgrass Linux - General 1 02-04-2009 05:04 AM
GRUB won't load windows partition - root (hd0,0), Filesystem type unknown partition.. cillm527 Linux - Software 4 04-27-2008 06:44 AM
Trying to find another partition ashkael Linux - Hardware 3 02-08-2007 05:28 AM
Find out partition type aeruzcar Linux - General 2 07-29-2005 03:02 AM
Trying to find XP partition johannesc Linux - General 3 04-18-2004 11:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration